({ n })
| 7 | }, { flags: ['--expose-internals'] }); |
| 8 | |
| 9 | function main({ n }) { |
| 10 | const PriorityQueue = require('internal/priority_queue'); |
| 11 | const queue = new PriorityQueue(); |
| 12 | bench.start(); |
| 13 | for (let i = 0; i < n; i++) |
| 14 | queue.insert(Math.random() * 1e7 | 0); |
| 15 | for (let i = 0; i < n; i++) |
| 16 | queue.shift(); |
| 17 | bench.end(n); |
| 18 | } |