const https = require('https');
const CacheableLookup = require('cacheable-lookup');
const cacheable = new CacheableLookup();
// cacheable.install(https.globalAgent);
https.get('https://google.com', (response) => {
response.resume();
response.once('end', () => {
const second = https.get('https://google.com', (secondResponse) => {
secondResponse.resume();
});
second.once('socket', () => {
const socketTime = Date.now();
second.socket.once('lookup', () => {
console.log(Date.now() - socketTime);
});
});
});
});