s = setInterval(function(){ //需要执行的函数 alert("我延迟了2秒弹出"); },2000);
并不是每2秒执行一次,而是延迟2秒执行
js sleep效果
原文:http://www.cnblogs.com/sheapchen/p/4040355.html