Created
April 14, 2017 23:39
-
-
Save ericnakagawa/d32b3a6220cda37b5c20acb29c43cc74 to your computer and use it in GitHub Desktop.
SetInterval for a JS loop
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
var iLoop, iMain; | |
function loop() { | |
clearInterval(iLoop) | |
iLoop = setInterval(process, 1000); | |
console.log("loop()"); | |
} | |
function process() { | |
console.log("process()") | |
} | |
iMain = setInterval(loop, 1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment