Skip to content

Instantly share code, notes, and snippets.

View Christoph142's full-sized avatar

Christoph Christoph142

View GitHub Profile
@Christoph142
Christoph142 / scrollperformance.js
Last active October 11, 2015 19:57 — forked from da2x/scrollperformance.js
Bookmarklet for measuring scrolling performance
javascript:q=Date.now();w=0;a=3;s=10;m=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-window.innerHeight+10;e=setInterval("w+=s;if(w<m&&w>=0)window.scrollTo(0,w);else if(--a){s=-s}else{clearInterval(e);alert(Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)>window.innerHeight?('It takes approximately '+Math.round((Date.now()-q)/(3*(Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-window.innerHeight)/window.innerHeight))/1000+' seconds to scroll this document by one page'):'scrolling measurement is only possible if the window can actually be scrolled!');}",0);void 0;