Created
February 14, 2015 21:07
-
-
Save bendytree/615960cc9cb583d75cac to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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