定时器时间动态变化(变速)
var temp; var time=100; var m = 1; setfun(); function setfun(){ temp = setInterval(function(){ console.log('执行1次'+time); clearInterval(temp); setfun(); },time); m++; time = m*100; }
var temp; var time=100; var m = 1; setfun(); function setfun(){ temp = setInterval(function(){ console.log('执行1次'+time); clearInterval(temp); setfun(); },time); m++; time = m*100; }