Created
April 11, 2017 07:12
-
-
Save zymiboxpay/1359b0b987948aeaccb65f6cc984bd5b to your computer and use it in GitHub Desktop.
根据条件,间隔一定时间执行同一段代码
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 i = 0; | |
setTimeout(function timeoutFunc(){ | |
if(i < 10){ | |
i ++; | |
console.log(i); | |
setTimeout(timeoutFunc, 1000); | |
} | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment