(ms: number)
| 106 | } |
| 107 | |
| 108 | function formatMs(ms: number): string { |
| 109 | if (ms < 0.001) return `${(ms * 1000).toFixed(1)}µs`; |
| 110 | if (ms < 1) return `${ms.toFixed(4)}ms`; |
| 111 | return `${ms.toFixed(1)}ms`; |
| 112 | } |
| 113 | |
| 114 | function printBenchTable(results: BenchResult[]) { |
| 115 | const nameW = Math.max(25, ...results.map((r) => r.name.length)); |
no test coverage detected