js定时操作

参考

function func(){console.log("print")} //定时任务
var interval = setInterval(func, 2000); //启动,func不能使用括号
clearInterval(interval );//停止
interval = setInterval(func, 2000); //重新启动即可
原文地址:https://www.cnblogs.com/lvlin241/p/12770471.html