diff --git a/test/public/app.js b/test/public/app.js index 546ab79..9f80859 100644 --- a/test/public/app.js +++ b/test/public/app.js @@ -47,8 +47,10 @@ function runTests() { } function runTest(name, canvas, dest) { - var fn = tests[name]; + var fn = tests[name] + , start = new Date; fn(canvas.getContext('2d')); + canvas.title += ' (rendered in ' + (new Date - start) + 'ms)'; renderOnServer(name, canvas, function(res){ if (res.error) { var p = create('p'); @@ -57,7 +59,7 @@ function runTest(name, canvas, dest) { } else if (res.data) { var img = create('image'); img.src = res.data; - img.alt = img.title = name; + img.alt = img.title = name + ' (rendered in ' + res.duration + 'ms)'; dest.appendChild(img); } }); diff --git a/test/server.js b/test/server.js index e170f8c..9f8f45c 100644 --- a/test/server.js +++ b/test/server.js @@ -35,9 +35,10 @@ app.post('/render', function(req, res, next){ , width = req.body.width , height = req.body.height , canvas = new Canvas(width, height) - , ctx = canvas.getContext('2d'); + , ctx = canvas.getContext('2d') + , start = new Date; fn(ctx); - res.send({ data: canvas.toDataURL() }); + res.send({ data: canvas.toDataURL(), duration: new Date - start }); }); app.listen(3000);