Skip to content

Instantly share code, notes, and snippets.

@sidorares
Created July 15, 2011 04:44
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 sidorares/1084086 to your computer and use it in GitHub Desktop.
Save sidorares/1084086 to your computer and use it in GitHub Desktop.
nextTick benchmark
var counter = 0;
setInterval(function() {
console.log(counter);
counter = 0;
}, 1000);
function loop()
{
counter++;
process.nextTick(function() { loop(); });
// setTimeout(loop, 0);
}
loop();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment