Created
June 25, 2018 07:37
-
-
Save chnbohwr/fb901c40cacff6f4972628b974f4a3e6 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 { parentPort, workerData } = require('worker_threads'); | |
console.log(workerData); | |
let b = 0; | |
for (let i = 0; i < 1000; i += workerData.base) { | |
b += i; | |
} | |
parentPort.postMessage(b); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment