<Enter a one-sentence description of this project here.>
Project description
A context manager for timing code.
Typical use:
# Create a Stopwath with and end message string and printed 3 digits
with Stopwatch("time 5 times 'sleep(1)': ",ndigits=3) as tmr:
for i in range(5):
sleep(1) # supposing there isn't anything more useful to oo ;-)
print(i,tmr.timelapse()) # time since last call to timelapse()
print(tmr.time) # the total time
Running this code yields:
0 1.004
1 1.004
2 1.004
3 1.004
4 1.004
time 5 times 'sleep(1)': 5.02 s
5.02
Free software: MIT license
Documentation: https://et-stopwatch.readthedocs.io.
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
et-stopwatch-0.3.0.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for et_stopwatch-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2575e024acae2843974fef2c13f83478c998daca251a7e94f981bd21f9df4da2 |
|
MD5 | 55c485a80f68bd038d15d0c7bd36eb96 |
|
BLAKE2b-256 | 7340ac204dcb6f0f7c8d8bc8b78546ce80db2502f84e8ad84b4250266ee22a8e |