From 1ac7064cad8184546465d95f33b879849b1348f7 Mon Sep 17 00:00:00 2001 From: Julian Viereck Date: Sun, 26 Jun 2011 11:46:58 +0200 Subject: [PATCH] Add more timing logs --- worker/client.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/worker/client.js b/worker/client.js index f932960e3..31975eeb8 100644 --- a/worker/client.js +++ b/worker/client.js @@ -347,7 +347,7 @@ function WorkerPDFDoc(canvas) { var renderData = function() { if (id == 0) { - console.time("canvas rendering"); + console.time("main canvas rendering"); var ctx = this.ctx; ctx.save(); ctx.fillStyle = "rgb(255, 255, 255)"; @@ -355,7 +355,10 @@ function WorkerPDFDoc(canvas) { ctx.restore(); } renderProxyCanvas(canvasList[id], cmdQueue); - if (id == 0) console.timeEnd("canvas rendering") + if (id == 0) { + console.timeEnd("main canvas rendering"); + console.timeEnd(">>> total page display time:"); + } }.bind(this); if (this.waitingForFonts) { @@ -403,6 +406,8 @@ WorkerPDFDoc.prototype.open = function(url, callback) { WorkerPDFDoc.prototype.showPage = function(numPage) { this.numPage = parseInt(numPage); + console.log("=== start rendering page " + numPage + " ==="); + console.time(">>> total page display time:"); this.worker.postMessage(numPage); if (this.onChangePage) { this.onChangePage(numPage);