关于process.nextTick触发次数的问题
 发布于 12 年前  作者 jabez128  4176 次预览  最后一次回复是 12 年前  来自  

我想研究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);