From: Chris Jones Date: Thu, 5 May 2011 02:39:07 +0000 (-0500) Subject: Added dumb profiling instrumentation X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=a073e45eba4ce9e3780e2252652cc37ddad8cc72;p=pdf.js.git Added dumb profiling instrumentation --- diff --git a/test.html b/test.html index 22e9101..16bedf9 100644 --- a/test.html +++ b/test.html @@ -43,6 +43,19 @@ function prevPage() { pageNum = (pageNum - 1 + numPages) % numPages; displayPage(pageNum); } + +function profile() { + const NUM_TRIALS = 10000; + var start = Date.now(); + for (var i = 0; i < NUM_TRIALS; ++i) + displayPage(pageNum); + var end = Date.now(); + var elapsed = (end - start); + + alert("Drawing current page "+ NUM_TRIALS +" times took "+ + (elapsed / 1000.0) +" seconds, "+ + "~"+ (elapsed / NUM_TRIALS) +" ms/draw (totally unscientific)"); +} @@ -51,6 +64,7 @@ function prevPage() { +