Windows机器默认时钟精度为10-15.6毫秒(大部分情况是15.6毫秒),亦即浏览器采用的系统时钟;
(function aa(){
console.log('start');
setTimeout(function(){
console.log('setTimeout 0');
},0);
console.log('this should before setTimeout 0');
var i=0;
while (i<1000000){
i++;
}
})();
(function aa(){
console.log('start');
setTimeout(function(){
console.log('setTimeout 0');
},0);
console.log('this should before setTimeout 0');
var i=0;
while (i<1000000){
i++;
}
})();
转载于:https://www.cnblogs.com/vvch/p/4961178.html