Last active
December 17, 2015 11:49
-
-
Save functionite/5604962 to your computer and use it in GitHub Desktop.
how many of node.js developers are aware of that?
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 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