varorderTimeOut=900000;vartimer=setInterval(()=>{orderTimeOut-=10;if(orderTimeOut>10){times=overTime(orderTimeOut);console.log(times)}else{orderTimeOut=0;times="00:00:00";}},10);functionoverTime(time){vara=(time%1000).toString().substr(0,2);varb=Math.floor(time/1000);varm=b%60;m=String(m);m=m.length>=2?m:"0"+m;varf=Math.floor(time/(1000*60));f=String(f);f=f.length>=2?f:"0"+f;returnf+":"+m+"."+a;}這段方法能夠正常進(jìn)行倒計(jì)時(shí),但是觀察到,它似乎越跑越慢.....
我的這段js倒計(jì)時(shí)為什么越走越慢?
慕的地6264312
2019-05-20 17:21:57