📜  js 每 x 秒执行一次 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:31.627000             🧑  作者: Mango

代码示例3
// your function
function myTimer() {
    console.log(' each 1 second...');
}

var myVar = setInterval(myTimer, 1000); //setting the loop with time interval

clearInterval(myVar); //call this line to stop the loop