Created
May 3, 2012 17:56
-
-
Save ephekt/2587605 to your computer and use it in GitHub Desktop.
asynchronous goofba
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
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