Skip to content

Instantly share code, notes, and snippets.

@shinout
Created October 12, 2011 15:23
Show Gist options
  • Save shinout/1281505 to your computer and use it in GitHub Desktop.
Save shinout/1281505 to your computer and use it in GitHub Desktop.
eternal nextTick
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);
@shinout
Copy link
Author

shinout commented Oct 12, 2011

nextTickはどこまでも。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment