Skip to content

Instantly share code, notes, and snippets.

@rpf5573 rpf5573/test.js
Created Sep 26, 2018

Embed
What would you like to do?
network io
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
You can’t perform that action at this time.