We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setInterval 应该是比较高频. 有些场景需要执行定时器之前先执行一次 setInterval 函数.
setInterval
setInterval 函数
通常可以使用下面的方式.
let count = 1; function exampleFunction() { console.log('Function Executed! ' + count); count = count + 1; } function noDelaySetInterval(func, interval) { func(); return setInterval(func, interval); } function startSetInterval() { noDelaySetInterval(exampleFunction, 3000); }
function startSetInterval() { let count = 1; setInterval(function exampleFunction() { console.log('Function Executed! ' + count); count = count + 1; return exampleFunction; }(), 3000); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
setInterval
应该是比较高频. 有些场景需要执行定时器之前先执行一次setInterval 函数
.通常可以使用下面的方式.
在执行 setInterval 之前执行
在 setInterval 函数中使用立即调用函数
The text was updated successfully, but these errors were encountered: