Created
September 4, 2013 18:05
-
-
Save DavidBruant/6440546 to your computer and use it in GitHub Desktop.
Breaking up large computation
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
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