Skip to content

Instantly share code, notes, and snippets.

@chnbohwr
Created June 25, 2018 07:23
Show Gist options
  • Save chnbohwr/dbf6120ee9bb3ad1d09373c42e305824 to your computer and use it in GitHub Desktop.
Save chnbohwr/dbf6120ee9bb3ad1d09373c42e305824 to your computer and use it in GitHub Desktop.
const { parentPort } = require('worker_threads');
let b = 0;
for (let i = 0; i < 1000; i++) {
b += i;
}
parentPort.postMessage(b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment