Open LuckyWinty opened 4 years ago
setTimeout(() => { console.log('setTimeout') }, 0) setImmediate(() => { console.log('setImmediate') }) const start = Date.now() while (Date.now() - start < 10);
输出为: setTimeout setImmediate
因为执行timers阶段前的时间大于1ms