Created
October 28, 2016 03:36
-
-
Save ccnokes/08e58e012d196a2f4d45e0dfb3074763 to your computer and use it in GitHub Desktop.
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 crypto = require('crypto'); | |
// this usually takes a few seconds | |
function work(limit = 100000) { | |
let start = Date.now(); | |
n = 0; | |
while(n < limit) { | |
crypto.randomBytes(2048); | |
n++; | |
} | |
return { | |
timeElapsed: Date.now() - start, | |
}; | |
} | |
module.exports = work; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment