标签:setTimeout

HTML5

process.nextTick() 教程

herman 6年前 (2018-02-23) 3450浏览 0评论

process.nextTick() 是 Node 的一个定时器,让任务可以在指定的时间运行。其中 Node 一共提供了4个定时器,它们分别是 setTimeout()、setInterval()、setImmediate()、process.n...

HTML5

setTimeout 和 setImmediate

herman 6年前 (2018-02-23) 2081浏览 0评论

由于setTimeout在 timers 阶段执行,而setImmediate在 check 阶段执行。所以,setTimeout会早于setImmediate完成。 setTimeout(() => console.log(1));...