Timing class for measuring elapsed time and average elapsed time.
Project description
noiftimer
Simple timer class to track average elapsed time with optional sub-second precision.
Install with:
pip install noiftimer
Usage:
from noiftimer import Timer import time def very_complicated_function(): time.sleep(1) timer = Timer() for _ in range(10): timer.start() very_complicated_function() timer.stop() print(f'{timer.average_elapsed_time=}') print(timer.get_stats(subsecond_resolution=True))
produces
timer.average_elapsed_time=1.0006019 elapsed time: 1s 836us average elapsed time: 1s 601us
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
noiftimer-1.3.0.tar.gz
(43.2 kB
view hashes)
Built Distribution
Close
Hashes for noiftimer-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89346c25622eb7a4c622a9b6d8a0cc6d1066b31da055e40957c1ea2390ad1198 |
|
MD5 | 66ca48f62b457ed040c83ff665ef8625 |
|
BLAKE2b-256 | 81128068a8ed9ab1062e3e5e67e9bb211ec09251a219d02a42d4be175f182bc7 |