Created
August 21, 2015 22:24
-
-
Save mykolaharmash/f85cd6e1f879fcb1113b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fucntion fn () { | |
setImmediate(function () { | |
console.log('setImmediate'); | |
}); | |
process.nextTick(function () { | |
console.log('nextTick'); | |
}); | |
} | |
fn(); | |
// nextTick | |
// setImmediate | |
process.nextTick() inserts a task at the end of the current | |
event loop turn queue, whereas setImmediate() inserts a task | |
at the beginning of the next event loop turn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment