Skip to content

Instantly share code, notes, and snippets.

@mrwillihog
Created March 29, 2015 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrwillihog/a26e4afced4868a71fdb to your computer and use it in GitHub Desktop.
Save mrwillihog/a26e4afced4868a71fdb to your computer and use it in GitHub Desktop.
request all the things
var async = require('async');
var request = require('request').defaults({
time: true
});
var urls = [
'http://www.example.com'
// ... 5000 URLs
];
async.each(urls, function(url, done) {
request(url, function(err, res, body) {
console.log(url, res.elapsedTime + 'ms');
done();
});
}, function() {
console.log('fini');
});
@mrwillihog
Copy link
Author

res.elapsedTime only ever increases - despite the server maintaining a constant response time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment