1 const FixedThreadPool
= require('../lib/fixed')
3 const pool
= new FixedThreadPool(15,
5 { errorHandler
: (e
) => console
.error(e
), onlineHandler
: () => console
.log('worker is online') })
7 const start
= Date
.now()
8 const iterations
= 1000
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
))