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.0.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for noiftimer-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89b221dc0fbc15e56e60970f341ba69a362f6fd3a91c53b646fa38b35a510f46 |
|
MD5 | 3cece16eaaa21d439c53014a30e17053 |
|
BLAKE2b-256 | df8bb42cf91f4b1e33e8e562c636443e88a66d3beb231c2fab0387ee04f30510 |