Created
November 11, 2014 15:35
-
-
Save AWaselnuk/d678c1a6770bc2fbeb40 to your computer and use it in GitHub Desktop.
Improved setInterval
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
// BAD | |
setInterval(function(){ | |
doStuff(); | |
}, 100); | |
// GOOD | |
(function loopMe(){ | |
doStuff(); | |
setTimeout(loopMe, 100); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment