Created
March 17, 2018 00:28
-
-
Save amazingandyyy/1075489a3f6f94d13b2ab76cff4c7cea 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
const https = require('https'); | |
const crypto = require('crypto'); | |
const fs = require('fs'); | |
const start = Date.now(); | |
function doRequest(){ | |
https | |
.request('https://www.google.com', (res)=>{ | |
res.on('data',()=>{}); | |
res.on('end',()=>{ | |
console.log('Request', Date.now() - start); | |
}); | |
}) | |
.end(); | |
} | |
function doHash(){ | |
crypto.pbkdf2('a', 'b', 100000, 512, 'sha256', ()=>{ | |
console.log('Hash:', Date.now()-start); | |
}); | |
} | |
doRequest(); | |
fs.readFile('multitask.js', 'utf-8', ()=>{ | |
console.log('FS:', Date.now() - start); | |
}) | |
doHash() | |
doHash() | |
doHash() | |
doHash() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment