()
| 8 | export {Benchmark, Options}; |
| 9 | |
| 10 | export async function main() { |
| 11 | const duration = process.env.DURATION ?? '30'; |
| 12 | const options: Options = { |
| 13 | duration: +duration, |
| 14 | }; |
| 15 | const bench = new Benchmark(options); |
| 16 | bench.logger = (title, stats) => console.log('%s:', title, stats); |
| 17 | await bench.run(); |
| 18 | } |
| 19 | |
| 20 | if (require.main === module) { |
| 21 | main().then( |