A simple stopwatch for python
Project description
A simple stopwatch for Python.
Install
Requires Python 3.5+
pip install stopwatch.py
Usage
from stopwatch import Stopwatch
# Argument specifies decimal precision for __str__
# e.g 2 digits = 1.00, 3 digits = 1.000
# Optional, defaults to 2
stopwatch = Stopwatch(2) # Start a stopwatch
# It's just math with time.perf_counter() so there isn't really a task
# running in background
stopwatch.stop() # Stop stopwatch, time freezes
stopwatch.start() # Start it again
stopwatch.reset() # Reset it back to 0
stopwatch.restart() # Reset and start again
stopwatch.running # Wether stopwatch is running
stopwatch.duration # Get the duration (in seconds)
str(stopwatch) # Get a friendly duration string
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stopwatch.py-2.0.0.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for stopwatch.py-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03ab3ee2876900cca1b830a2bcc4b1d29c536255724c6b0f5cb308992558d910 |
|
MD5 | 53a830e4e10a4960b66a9e0db659d7fd |
|
BLAKE2b-256 | 11036dad7eec95ce3871cb5a421d97fc7f955f6e9fe52bad98cab265ac7e1d0a |