New benchmarking without any library to better understand how the bench is executed...
[poolifier.git] / benchmarks / externalWorker.js
... / ...
CommitLineData
1const {
2 isMainThread,
3 parentPort
4} = require('worker_threads')
5
6if (!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}