(samples: number[])
| 21 | const LONG = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. '.repeat(60); |
| 22 | |
| 23 | function p50(samples: number[]): number { |
| 24 | const sorted = [...samples].sort((a, b) => a - b); |
| 25 | return sorted[Math.floor(sorted.length * 0.5)]; |
| 26 | } |
| 27 | |
| 28 | async function time(fn: () => Promise<void>): Promise<number> { |
| 29 | const t0 = Date.now(); |