Created
September 20, 2012 10:54
-
-
Save da2x/3755211 to your computer and use it in GitHub Desktop.
Bookmarklet for measuring scrolling performance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:q=Date.now();w=0;a=3;s=10;e=setInterval("w+=s;if(w<document.body.scrollHeight&&w>=0)window.scrollTo(0,w);else if(--a){s=-s}else{clearInterval(e);alert(Date.now()-q);}",0);void 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
javascript:q=Date.now();w=0;a=3;s=10;e=setInterval("w+=s;if(w<document.body.scrollHeight&&w>=0)window.scrollTo(0,w);else if(--a){s=-s}else{clearInterval(e);alert(document.body.scrollHeight>window.innerHeight?('It takes approximately '+Math.round((Date.now()-q)/(3*(document.body.scrollHeight-window.innerHeight)/window.innerHeight))/1000+' seconds to scroll this document by one page'):'scrolling mearsurement is only possible if the window can actually be scrolled!');}",0);void 0;
would be better IMHO, because it gives you an idea of the actual performance and is comparable across websites ;)