Created
September 26, 2018 11:04
-
-
Save rpf5573/603a3e8c2b1f87fc2b9abf617c837415 to your computer and use it in GitHub Desktop.
network io
This file contains 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
const https = require('https'); | |
const start = Date.now(); | |
https.request('https://www.google.com', res => { | |
res.on('data', () => {}); | |
res.on('end', () => { | |
console.log(Date.now() - start); | |
}); | |
}).end(); | |
https.request('https://www.google.com', res => { | |
res.on('data', () => {}); | |
res.on('end', () => { | |
console.log(Date.now() - start); | |
}); | |
}).end(); | |
https.request('https://www.google.com', res => { | |
res.on('data', () => {}); | |
res.on('end', () => { | |
console.log(Date.now() - start); | |
}); | |
}).end(); | |
https.request('https://www.google.com', res => { | |
res.on('data', () => {}); | |
res.on('end', () => { | |
console.log(Date.now() - start); | |
}); | |
}).end(); | |
https.request('https://www.google.com', res => { | |
res.on('data', () => {}); | |
res.on('end', () => { | |
console.log(Date.now() - start); | |
}); | |
}).end(); | |
// output | |
// 396 | |
// 401 | |
// 402 | |
// 404 | |
// 410 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment