Skip to content

Instantly share code, notes, and snippets.

@piscisaureus
Created May 22, 2012 15:52
Show Gist options
  • Save piscisaureus/2769922 to your computer and use it in GitHub Desktop.
Save piscisaureus/2769922 to your computer and use it in GitHub Desktop.
function timeout() {
console.log("timeout");
process.nextTick(function() {
console.log("nexttick set by timer");
});
}
function tick() {
for (var i = 0; i < 1e6; i++) {}
console.log("nexttick set by nexttick");
process.nextTick(tick);
}
process.nextTick(tick);
setInterval(timeout, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment