📜  setinterval vs settimeout js - Javascript代码示例

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

代码示例3
var intervalID = setInterval(alert, 1000); // Will alert every second.
// clearInterval(intervalID); // Will clear the timer.

setTimeout(alert, 1000); // Will alert once, after a second.