nodejsで時間実行の手順

393 ワード

setImmediate(function () {
    console.log('immediate');
})

setTimeout(function () {
    console.log('setTimeout 0ms');
}, 0)

setTimeout(function () {
    console.log('setTimeout 10ms');
}, 1000)

process.nextTick(function () {
    console.log('nextTick');
})
結果:
nextTick
setTimeout 0ms
immediate
setTimeout 10ms