Created
February 9, 2017 14:15
-
-
Save ClaudiuCreanga/4e9bc648a365a22c0225837cc55eda30 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
setInterval() <-issues because sometimes it doesn’t finish before the next function starts. To solve it make setTimeout call itself: | |
(function(){ | |
doStuff(); | |
setTimeout(arguments.callee,100) | |
}() | |
arguments.callee to refer to the currently executing function | |
or better: | |
(function names(){ | |
doStuff(); | |
setTimeout(names,100) | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment