Skip to content

Instantly share code, notes, and snippets.

@bendytree
Created February 14, 2015 21:07
Show Gist options
  • Select an option

  • Save bendytree/615960cc9cb583d75cac to your computer and use it in GitHub Desktop.

Select an option

Save bendytree/615960cc9cb583d75cac to your computer and use it in GitHub Desktop.
var async = require('async');
var https = require('https');
async.times(5, function(n, cb){
var options = { host: 'www.google.com', port: 443, path: '', method: 'GET' };
var startTime = new Date().getTime();
var req = https.request(options, function(res) {
var ms = new Date().getTime() - startTime;
console.log(ms+"ms");
res.on('data', function(){ });
res.on('end', function(){ cb(); });
});
req.on('error', cb);
req.end();
}, function(err){ });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment