Commit | Line | Data |
---|---|---|
7f685093 | 1 | // IMPORT LIBRARIES |
73cda448 | 2 | const threadPool = require('./pool-threadwork') |
7f685093 | 3 | // FINISH IMPORT LIBRARIES |
79e7d368 | 4 | const iterations = Number(process.env.NUM_ITERATIONS) |
7f685093 JB |
5 | const data = { |
6 | test: 'MYBENCH', | |
7 | taskType: process.env['TASK_TYPE'] | |
8 | } | |
9 | ||
7f685093 JB |
10 | async function run () { |
11 | const promises = [] | |
12 | for (let i = 0; i < iterations; i++) { | |
13 | promises.push(threadPool.run(data)) | |
14 | } | |
15 | await Promise.all(promises) | |
16 | process.exit() | |
17 | } | |
18 | ||
19 | run() |