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.0.tar.gz
(6.5 kB
view hashes)
Built Distribution
Close
Hashes for noiftimer-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9049d86a745b2dcdbe3d839eb91f4ce9e5fbd73d42cd441acaa972671ab4b703 |
|
MD5 | 063f672ac68abdd7a12afd2594bff305 |
|
BLAKE2b-256 | c0ff0b3743d76501775fce8ded5445c5d57ca2a1a0c6581fd1c9e18a62bcdf27 |