Cleanups on bechmarking and strategies code: (#227)
[poolifier.git] / benchmarks / internal / benchmark-utils.js
CommitLineData
ff5e76e1
JB
1async function runTest (pool, { tasks, workerData }) {
2 return new Promise((resolve, reject) => {
3 let executions = 0
4 for (let i = 0; i <= tasks; i++) {
5 pool
6 .execute(workerData)
7 .then(res => {
8 executions++
9 if (executions === tasks) {
10 return resolve('FINISH')
11 }
12 return null
13 })
14 .catch(err => console.error(err))
15 }
16 })
17}
18
19module.exports = { runTest }