Created
July 15, 2011 04:44
-
-
Save sidorares/1084086 to your computer and use it in GitHub Desktop.
nextTick benchmark
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
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