更新时间:2022-02-26 06:53:02
请考虑使用setInterval而不是setTimeout。它将自动重复,直到你清除间隔。
Instead of setTimeout, consider using setInterval. It will repeat automatically until you clear the interval.
setInterval(myMethod, 5000);
function myMethod( )
{
//this will repeat every 5 seconds
//you can reset counter here
}