Time a block of code or function, and set the duration in seconds. Can be used as a function decorator or context manager.
(self)
| 478 | return InprogressTracker(self) |
| 479 | |
| 480 | def time(self) -> Timer: |
| 481 | """Time a block of code or function, and set the duration in seconds. |
| 482 | |
| 483 | Can be used as a function decorator or context manager. |
| 484 | """ |
| 485 | return Timer(self, 'set') |
| 486 | |
| 487 | def set_function(self, f: Callable[[], float]) -> None: |
| 488 | """Call the provided function to return the Gauge value. |