refactor: use named export in benchmarking code
[poolifier.git] / benchmarks / versus-external-pools / fixed-threadwork.mjs
CommitLineData
7f685093 1// IMPORT LIBRARIES
8fca9288 2import threadPool from './pool-threadwork'
7f685093 3// FINISH IMPORT LIBRARIES
6bd72cd0 4const iterations = parseInt(process.env.NUM_ITERATIONS)
7f685093
JB
5const data = {
6 test: 'MYBENCH',
7a6a0a96 7 taskType: process.env.TASK_TYPE,
6bd72cd0 8 taskSize: parseInt(process.env.TASK_SIZE)
7f685093
JB
9}
10
7f685093
JB
11async function run () {
12 const promises = []
13 for (let i = 0; i < iterations; i++) {
14 promises.push(threadPool.run(data))
15 }
16 await Promise.all(promises)
2f8c5b5c 17 // eslint-disable-next-line n/no-process-exit
7f685093
JB
18 process.exit()
19}
20
8fca9288 21await run()