Created
October 12, 2011 15:23
-
-
Save shinout/1281505 to your computer and use it in GitHub Desktop.
eternal nextTick
This file contains hidden or 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 N = 1000000; | |
process.nextTick(function nextTick(n) { | |
n = n || 1; | |
if (n < N) process.nextTick(nextTick.bind(null, ++n)); | |
else clearInterval(timeId); | |
}); | |
var timeId = setInterval(function() { | |
console.log("."); | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nextTickはどこまでも。