({ n, pending })
| 30 | } |
| 31 | |
| 32 | function main({ n, pending }) { |
| 33 | const timerfied = performance.timerify(randomFn); |
| 34 | |
| 35 | let count = 0; |
| 36 | const obs = new PerformanceObserver((entries) => { |
| 37 | count += entries.getEntries().length; |
| 38 | |
| 39 | if (count >= n) { |
| 40 | bench.end(count); |
| 41 | } else { |
| 42 | fillQueue(timerfied, pending); |
| 43 | } |
| 44 | }); |
| 45 | obs.observe({ entryTypes: ['function'], buffered: true }); |
| 46 | |
| 47 | bench.start(); |
| 48 | fillQueue(timerfied, pending); |
| 49 | } |
nothing calls this directly
no test coverage detected