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 veryComplicatedFunction(): time.sleep(1) timer = Timer(subsecondFormat=True) for _ in range(10): timer.start() veryComplicatedFunction() timer.stop() print(f'{timer.averageElapsedTime=}') print(timer.getStats())
produces
timer.averageElapsedTime=1.0005153999999998 elapsed time: 1s 871us average elapsed time: 1s 515us
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-0.1.1.tar.gz
(6.5 kB
view hashes)
Built Distribution
Close
Hashes for noiftimer-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65e4576ea6097029d534b8564fee4bfd1f50f17d39069576b4a403c1f41fd1c0 |
|
MD5 | e1fda1d240bbbcafbf75ddc2d0c45e08 |
|
BLAKE2b-256 | 4c326fbc8978135393bb5ef10e02acaeae3854b572047947ff2edeb6812a3a66 |