A simple context manager and decorator that measures time using perf_counter()
CC0-1.0 License
A simple context manager that measures time using perf_counter()
Install this via pip (or your favourite package manager):
pip install cm-time
from cm_time import timer
with timer() as t:
pass
print(t.elapsed)
Output:
Elapsed time: 0.000
0.0
from cm_time import timer_wrapped
@timer_wrapped()
def foo():
pass
Output:
foo: Elapsed time: 0.000
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
This package was created with Copier and the browniebroke/pypackage-template project template.