MCPcopy Create free account
hub / github.com/tox-dev/filelock / _timed

Function _timed

tasks/benchmark.py:186–190  ·  view source on GitHub ↗
(name: str, run: Callable[[], object], *, unit: str, scale: float)

Source from the content-addressed store, hash-verified

184
185
186def _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
193def _one(run: Callable[[], object]) -> float:

Callers 2

_constructionFunction · 0.85
_uncontendedFunction · 0.85

Calls 3

_oneFunction · 0.85
SampleClass · 0.85
_percentileFunction · 0.85

Tested by

no test coverage detected