最佳的前端监听事件触发方式

for (;;){
var start = new Date().getTime();
var newdate;
while (true) {
newdate=new Date().getTime();
if (newdate - start > 4000) {
start=newdate;
this.$log.log("66666661");
continue;
}
}
}

for (;;){
var start = new Date().getTime();
// console.log('休眠前:' + start);
var newdate;
while (true) {
newdate=new Date().getTime();
if (newdate - start > 2000) {
start=newdate;
this.addChead();
continue;
}
}
}
 
posted @ 2021-07-12 17:27  接口interface  阅读(320)  评论(0编辑  收藏  举报