Skip to content

Instantly share code, notes, and snippets.

@to
Created December 23, 2010 14:56
Show Gist options
  • Save to/753076 to your computer and use it in GitHub Desktop.
Save to/753076 to your computer and use it in GitHub Desktop.
var count = num = 1000;
var start = Date.now();
function proc(){
if(!--count){
console.log((Date.now() - start) / num);
return;
}
defer();
}
var script = document.createElement('script');
script.src = 'data:text/javascript,';
script.onload = function () {
document.body.removeChild(script);
proc();
}
function defer(){
document.body.appendChild(script);
}
defer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment