diff --git a/test.html b/test.html index 22e9101d2..16bedf93d 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() { +