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:
python -m 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.0.1.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for noiftimer-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7500b8d6338f966b8007463f7258c38b509e3ee8254fad44635565c4fc4b9d5c |
|
MD5 | b5923edf51672e7e184faaf34275a192 |
|
BLAKE2b-256 | ea34aecf652b7b9f4492824d8334e260facc49e6db6d66d02e950a8c772bf1ff |