JS setInterval

JS window.setInterval

window.setInterval(func, time);
func: 执行的函数, String,"hello()"
time: 执行间隔时间, 1000=1,1000*10

效果: 不阻塞反复每间隔time秒执行func函数
实例

function hello()
{
    console.log("hello");
}
window.setInterval("hello()", 0);

猜你喜欢

转载自blog.csdn.net/twxwjh/article/details/106877558