]> git.parisson.com Git - pdf.js.git/commitdiff
Add more timing logs
authorJulian Viereck <julian.viereck@gmail.com>
Sun, 26 Jun 2011 09:46:58 +0000 (11:46 +0200)
committerJulian Viereck <julian.viereck@gmail.com>
Tue, 28 Jun 2011 06:06:40 +0000 (08:06 +0200)
worker/client.js

index f932960e383c99c63958ecf1376573d249724d4d..31975eeb8b6ac8b492dc49092a5b8c169208a4b7 100644 (file)
@@ -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);