区别
setTimeOut只能运行一次;setInterval可运行多次,周期往复
注意
两者的时间都是以毫秒即时,下述代码中的180000的单位是ms ,定时时间为180s
用法
setInterval(function(){
console.log(canshu1);
console.log(canshu2);
},180000,canshu1,canshu2)
setTimeOut(function(){
console.log(canshu1);
console.log(canshu2);
},180000,canshu1,canshu2)