9fafbb5b2d7b92f53ff0ac74dd4e4a6566793763
[poolifier.git] / benchmarks / externalWorker.js
1 const {
2 isMainThread,
3 parentPort
4 } = require('worker_threads')
5
6 if (!isMainThread) {
7 for (let i = 0; i <= 1000; i++) {
8 const o = {
9 a: i
10 }
11 JSON.stringify(o)
12 }
13 // console.log('This is the main thread ' + isMainThread)
14 parentPort.postMessage({ ok: 1 })
15 }