src: move debug agent from deps/ to src/
[platform/upstream/nodejs.git] / benchmark / http_server_lag.js
1 var http = require('http');
2 var port = parseInt(process.env.PORT, 10) || 8000;
3 var defaultLag = parseInt(process.argv[2], 10) || 100;
4
5 http.createServer(function(req, res) {
6   res.writeHead(200, { 'content-type': 'text/plain',
7                        'content-length': '2' });
8
9   var lag = parseInt(req.url.split("/").pop(), 10) || defaultLag;
10   setTimeout(function() {
11     res.end('ok');
12   }, lag);
13 }).listen(port, 'localhost');