This is a fork from python-stopwatch, which adds static typing and a few other things.
- This package requires python 3.10 or higher.
Step 1. Install the library:
poetry add python-stopwatch2
Other platform? ➜ https://stopwatch2.vercel.app/guide/getting-started.html
Step 2. Import the Stopwatch class:
from stopwatch import Stopwatch
Step 3. Create a new Stopwatch object:
sw = Stopwatch()
Step 4. Place your code here:
from time import sleep
sleep(2)
Step 5. Stop the stopwatch:
sw.stop()
Step 6. Get the elapsed time:
print(f'Time elapsed: {sw.elapsed}') # Time elapsed: 2.0031827000002522
# or
print(f'Time elapsed: {sw}') # Time elapsed: 2.00s
You'll find installation instructions and full documentation on https://stopwatch2.vercel.app.
Run the tests with:
poetry run pytest --cov=stopwatch
Please see CHANGELOG for detailed changes for each release.
Please see CONTRIBUTING for details.
-
Copyright (c) 2021-2022 Jonghwan Hyeon, 2022-present Rafael
Release files for python-stopwatch2 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_stopwatch2-2.0.0.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_stopwatch2-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.8 kB
Release files / python_stopwatch2-2.0.0.tar.gz
| Download URL | python_stopwatch2-2.0.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c2bb62d1374de97429c4f5ba1188fea10b2a7c34af89f173c28ae38d5206b90
|
|
BLAKE2b-256 checksum How to use checksums |
51cd29c1f059e1f0e18280f1439698ce39f91d088b90c19d38083efbd27552e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.
Transparency logRelease files / python_stopwatch2-2.0.0-py3-none-any.whl
| Download URL | python_stopwatch2-2.0.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42b4351addaffaa3a2b347b5f2ca2a53d80264c2a76ec1631dc60131b92ab66c
|
|
BLAKE2b-256 checksum How to use checksums |
46e13d129cf109abe17e0de6a989a92c7683c1f743bd24f7616316f81bbc7588
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.
Transparency log