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 details)
Built Distribution
File details
Details for the file stopwatch.py-2.0.1.tar.gz
.
File metadata
- Download URL: stopwatch.py-2.0.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.8.3 requests/2.28.0 setuptools/58.1.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8cc94ba0f6469d434eabd8b227166e595fd42350e7f66dbf1a1a80697f60cc79
|
|
MD5 |
a682d3a86e2d779e8e560f9dfe27d1ed
|
|
BLAKE2b-256 |
8d141815e24c29c2f2ea1e8cb17ae72357c1151af02b9137b29ccab973ec7f73
|
File details
Details for the file stopwatch.py-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: stopwatch.py-2.0.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.8.3 requests/2.28.0 setuptools/58.1.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5802a0178d766120c11dd5df8ae838e9beccb8c88329dbd5f0f7ac4b7fed9107
|
|
MD5 |
b5d317f6900aa2c242511d5ad2493a48
|
|
BLAKE2b-256 |
7a6516e128bfa30b4d63362c5ead733bc5a95c2b4241a0a193dc44e290ab2080
|