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 # Whether 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.1.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for stopwatch.py-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5802a0178d766120c11dd5df8ae838e9beccb8c88329dbd5f0f7ac4b7fed9107 |
|
MD5 | b5d317f6900aa2c242511d5ad2493a48 |
|
BLAKE2b-256 | 7a6516e128bfa30b4d63362c5ead733bc5a95c2b4241a0a193dc44e290ab2080 |