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.0.1.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for noiftimer-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ba4fa402d767cb3b63f6c081f8f45478b24bc7466e706b30407fb0ab19269c2 |
|
MD5 | d31182000a83a09ee6a73554f3a205b5 |
|
BLAKE2b-256 | 5bb1e21470510d96e20d330a51eba9044d456b179ef3bf3c27b800991953a875 |