TODO added
[poolifier.git] / proof.js
... / ...
CommitLineData
1const FixedThreadPool = require('./lib/fixed')
2const DynamicThreadPool = require('./lib/dynamic')
3let resolved = 0
4// const pool = new FixedThreadPool(15, './yourWorker.js')
5const pool = new DynamicThreadPool(300, 1020, './yourWorker.js')
6
7const start = Date.now()
8const iterations = 300
9for (let i = 0; i <= iterations; i++) {
10 pool.execute({}).then(res => {
11 resolved++
12 if (resolved === iterations) {
13 console.log('Time take is ' + (Date.now() - start))
14 }
15 })
16}