Skip to content

Instantly share code, notes, and snippets.

@DavidBruant
Created September 4, 2013 18:05
Show Gist options
  • Save DavidBruant/6440546 to your computer and use it in GitHub Desktop.
Save DavidBruant/6440546 to your computer and use it in GitHub Desktop.
Breaking up large computation
var MAX = 10;
var times = [];
var now = performance.now.bind(performance)
for(var i=0; i<MAX; i++){
setTimeout(function f(){
times.push(now());
}, 0);
}
setTimeout(function (){
console.log(times);
}, MAX*10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment