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.2.0.tar.gz
(44.6 kB
view hashes)
Built Distribution
Close
Hashes for noiftimer-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e44213d418fed2757fd0582958db59ad5c3d3579548c4fdbf556c8e9c864a2e7 |
|
MD5 | 936b726a3cc3a5c5c2817bb109760e89 |
|
BLAKE2b-256 | 98206237a396045ce12cfbf31c78e0ce6cabd774a41cb43092344af52595ff2f |