我想研究1s内process.nextTick的触发次数,下面的代码有没有什么问题:
var fireCount = 0;
var start = new Date;
while(new Date - start < 1000){
process.nextTick(function(){fireCount++;});
}
setTimeout(function(){console.log(fireCount);}, 1000);
我想研究1s内process.nextTick的触发次数,下面的代码有没有什么问题:
var fireCount = 0;
var start = new Date;
while(new Date - start < 1000){
process.nextTick(function(){fireCount++;});
}
setTimeout(function(){console.log(fireCount);}, 1000);