Skip to content

Instantly share code, notes, and snippets.

@rpastorelle
Created November 20, 2012 18:58
Show Gist options
  • Save rpastorelle/4120177 to your computer and use it in GitHub Desktop.
Save rpastorelle/4120177 to your computer and use it in GitHub Desktop.
Better setInterval
(function(){
doStuff();
setTimeout(arguments.callee, 100);
})();
@rpastorelle
Copy link
Author

AKA:

(function loop() {
    doStuff();
    setTimeout(loop, interval);
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment