Skip to content

Instantly share code, notes, and snippets.

@AWaselnuk
Created November 11, 2014 15:35
Show Gist options
  • Save AWaselnuk/d678c1a6770bc2fbeb40 to your computer and use it in GitHub Desktop.
Save AWaselnuk/d678c1a6770bc2fbeb40 to your computer and use it in GitHub Desktop.
Improved setInterval
// 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