Skip to content

Instantly share code, notes, and snippets.

@pjb3
Created September 29, 2011 00:37
Show Gist options
  • Select an option

  • Save pjb3/1249703 to your computer and use it in GitHub Desktop.

Select an option

Save pjb3/1249703 to your computer and use it in GitHub Desktop.
event loop
var puts = require('sys').puts
for(var i = 0; i < 5000; i++) {
setTimeout((function(n){
return (function() {
puts("done "+n);
})
})(i), 5000);
puts("created fn "+i)
}
puts("Done creating stuff")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment