Skip to content

Instantly share code, notes, and snippets.

@deepakgd
Last active October 23, 2021 09:36
Show Gist options
  • Save deepakgd/f0a6b8cf8dd6645ebf78cf69a46d14e0 to your computer and use it in GitHub Desktop.
Save deepakgd/f0a6b8cf8dd6645ebf78cf69a46d14e0 to your computer and use it in GitHub Desktop.
// SetTimeout, setImmediate and process.nextTick
function run() {
setTimeout(() => console.log(" I am setTimeout"), 0);
setImmediate(() => console.log("I am setImmediate"));
process.nextTick(() => console.log("I am nextTick"));
console.log("I am current event loop");
}
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment