Last active
October 20, 2018 02:29
-
-
Save rpf5573/5000c346e03e18747b7c176c18a0f6a9 to your computer and use it in GitHub Desktop.
setTimeout vs setImmediate
This file contains 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
//index.js | |
setTimeout(function(){ | |
console.log("SETTIMEOUT"); | |
}, 0); | |
setImmediate(function(){ | |
console.log("SETIMMEDIATE"); | |
}); | |
// output | |
// SETTIMEOUT | |
// SETIMMEDIATE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment