Skip to content

Instantly share code, notes, and snippets.

@mykolaharmash
Created August 21, 2015 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mykolaharmash/f85cd6e1f879fcb1113b to your computer and use it in GitHub Desktop.
Save mykolaharmash/f85cd6e1f879fcb1113b to your computer and use it in GitHub Desktop.
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