revise installing a license file
[platform/upstream/nodejs.git] / benchmark / http_server_lag.js
1 'use strict';
2
3 var http = require('http');
4 var port = parseInt(process.env.PORT, 10) || 8000;
5 var defaultLag = parseInt(process.argv[2], 10) || 100;
6
7 http.createServer(function(req, res) {
8   res.writeHead(200, { 'content-type': 'text/plain',
9                        'content-length': '2' });
10
11   var lag = parseInt(req.url.split('/').pop(), 10) || defaultLag;
12   setTimeout(function() {
13     res.end('ok');
14   }, lag);
15 }).listen(port, 'localhost');