Permalink
Browse files

Duration for voronoi

  • Loading branch information...
1 parent f582871 commit ef18e3f04a603afe280678759b6af7dfcde47d12 @tj tj committed Nov 10, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 examples/voronoi.js
View
@@ -12,7 +12,8 @@ var Canvas = require('../lib/canvas')
var voronoiFactory = require('./rhill-voronoi-core-min.js');
http.createServer(function (req, res) {
- var voronoi = voronoiFactory();
+ var voronoi = voronoiFactory()
+ , start = new Date;
var bbox = { xl: 0, xr: canvas.width, yt: 0, yb: canvas.height };
for (var i =0 ;i<340;i++)
@@ -130,6 +131,8 @@ http.createServer(function (req, res) {
}
canvas.toBuffer(function(err, buf){
+ var duration = new Date - start;
+ console.log('Rendered in %dms', duration);
res.writeHead(200, { 'Content-Type': 'image/png', 'Content-Length': buf.length });
res.end(buf);
});

0 comments on commit ef18e3f

Please sign in to comment.