timer#
- class arte.contrib.timer.Timer(unit='s', precision=2, msg='')#
Bases:
objectTimer context manager. Originally from https://stackoverflow.com/questions/5849800/tic-toc-functions-analog-in-python
and modified to support multiple time units
Example:
- with Timer(unit=’s’, msg=’foo’, precision=2):
long_function()
result: foo: Elapsed: 33.20 s