Created
September 3, 2015 11:38
-
-
Save walf443/641b37d280b75e1d0d64 to your computer and use it in GitHub Desktop.
run callback only in 200ms
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
window.requestIdleCallback(function(d) { for (i = 0; i < 1000000; i++) { if ( d.timeRemaining() == 0 ) { return } else { console.log([d.timeRemaining(), d.didTimeout]) } } }, 200) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment