(fn, batchSize)
| 950 | } |
| 951 | |
| 952 | function measureBatch(fn, batchSize) { |
| 953 | const start = process.hrtime.bigint(); |
| 954 | for (let i = 0; i < batchSize; i += 1) { |
| 955 | fn(); |
| 956 | } |
| 957 | return process.hrtime.bigint() - start; |
| 958 | } |
| 959 | |
| 960 | function benchmark(fn, minDurationSeconds) { |
| 961 | fn(); |