`with Timer() as t: ...; t.ms` — live millisecond wall time for the metadata block.
| 29 | |
| 30 | |
| 31 | class Timer: |
| 32 | """`with Timer() as t: ...; t.ms` — live millisecond wall time for the metadata block.""" |
| 33 | |
| 34 | def __enter__(self) -> "Timer": |
| 35 | self._start = time.monotonic() |
| 36 | return self |
| 37 | |
| 38 | def __exit__(self, *exc) -> None: |
| 39 | pass |
| 40 | |
| 41 | @property |
| 42 | def ms(self) -> int: |
| 43 | return int((time.monotonic() - self._start) * 1000) |
no outgoing calls
no test coverage detected