1 const FixedThreadPool
= require('./lib/fixed')
2 const DynamicThreadPool
= require('./lib/dynamic')
4 // const pool = new FixedThreadPool(15, './yourWorker.js')
5 const pool
= new DynamicThreadPool(300, 1020, './yourWorker.js')
7 const start
= Date
.now()
9 for (let i
= 0; i
<= iterations
; i
++) {
10 pool
.execute({}).then(res
=> {
12 if (resolved
=== iterations
) {
13 console
.log('Time take is ' + (Date
.now() - start
))