Last active
December 6, 2017 13:05
-
-
Save fhinkel/819c7292c4f503a5426077aaf0400157 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 js = require('./primes.js'); | |
const addon = require('./build/Release/primes.node'); | |
function run(i) { | |
console.time('Prime in js'); | |
js.prime(i); | |
console.timeEnd('Prime in js'); | |
console.time('Prime in addon'); | |
addon.prime(i); | |
console.timeEnd('Prime in addon'); | |
} | |
for(let i = 0; i < 1000000; i++) { | |
run(i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment