Skip to content

Instantly share code, notes, and snippets.

@functionite
Last active December 17, 2015 11:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save functionite/5604962 to your computer and use it in GitHub Desktop.
Save functionite/5604962 to your computer and use it in GitHub Desktop.
how many of node.js developers are aware of that?
var http = require('http');
var counter = 0;
var server = http.createServer(function(req, res){
var then = +new Date() + 9000;
if (counter == 0) {
while(+(new Date()) < then) {
}
counter = 1;
res.end("oh, hi");
} else {
res.end("hello world");
}
});
server.listen(1337, 'localhost');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment