Skip to content

Instantly share code, notes, and snippets.

@ephekt
Created May 3, 2012 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ephekt/2587605 to your computer and use it in GitHub Desktop.
Save ephekt/2587605 to your computer and use it in GitHub Desktop.
asynchronous goofba
Asynch Recursion
setInterval(function(){ doStuff(); },100);
// bad... but better is this
(function loop(){
doStuff();
setTimeout(loop,100);
})();
// now we wait 100 ms between doStuff run completions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment