Time a block of code or function, and observe the duration in seconds. Can be used as a function decorator or context manager.
(self)
| 556 | self._sum.inc(amount) |
| 557 | |
| 558 | def time(self) -> Timer: |
| 559 | """Time a block of code or function, and observe the duration in seconds. |
| 560 | |
| 561 | Can be used as a function decorator or context manager. |
| 562 | """ |
| 563 | return Timer(self, 'observe') |
| 564 | |
| 565 | def _child_samples(self) -> Iterable[Sample]: |
| 566 | samples = [ |