Method
__init__
(self, fmt='s', print_at_exit=True, timer=timeit.default_timer)
Source from the content-addressed store, hash-verified
| 27 | """ |
| 28 | |
| 29 | def __init__(self, fmt='s', print_at_exit=True, timer=timeit.default_timer): |
| 30 | assert fmt in ['ms', 's', 'datetime'], "`fmt` should be 'ms', 's' or 'datetime'!" |
| 31 | self._fmt = fmt |
| 32 | self._print_at_exit = print_at_exit |
| 33 | self._timer = timer |
| 34 | self.start() |
| 35 | |
| 36 | def __enter__(self): |
| 37 | """Start the timer in the context manager scope.""" |
Callers
nothing calls this directly
Tested by
no test coverage detected