(name: str, run: Callable[[], object], *, unit: str, scale: float)
| 184 | |
| 185 | |
| 186 | def _timed(name: str, run: Callable[[], object], *, unit: str, scale: float) -> Sample: |
| 187 | for _ in range(_WARMUP): |
| 188 | run() |
| 189 | durations = [_one(run) for _ in range(_ITERATIONS)] |
| 190 | return Sample(name, statistics.median(durations) * scale, _percentile(durations, 95) * scale, unit) |
| 191 | |
| 192 | |
| 193 | def _one(run: Callable[[], object]) -> float: |
no test coverage detected