Simple stop watch, allowing for timing of a number of tasks.
Project description
Simple stop watch, allowing for timing of a number of tasks, exposing total running time and running time for each named task - inspired by Spring Framework
Usage
import time
from stopwatch.stopwatch import StopWatch
sw = StopWatch("title")
sw.start("eat")
time.sleep(0.12)
sw.stop()
sw.start("sleep")
time.sleep(0.60)
sw.stop()
sw.start("work")
time.sleep(0.35)
sw.stop()
print(sw.pretty_print())
result:
-----------------------------------------
ms % Task name
-----------------------------------------
120 eat
605 sleep
351 work
-----------------------------------------
1077 total
Install
Pip
Install via pip:
pip install simple-stopwatch
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
Built Distribution
File details
Details for the file multi-task-stopwatch-0.1.0.tar.gz
.
File metadata
- Download URL: multi-task-stopwatch-0.1.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.13 Darwin/21.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 881991020629c51afada61b97ef07a646c88c49c77f96936f1e87017c728e7d1 |
|
MD5 | 187293e1f5f43b38981901f5eb6b9a5d |
|
BLAKE2b-256 | fc1a1d4d82afa73b33aad8964f285a47a671a670be1e1910c88659b4ef5bd027 |
File details
Details for the file multi_task_stopwatch-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: multi_task_stopwatch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.13 Darwin/21.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc9e13aac7b35218eb3a5d78a6f74f4dcac32f259ae8f71382fbf76b6880731b |
|
MD5 | 5f18f039facee231d2f8dd31596424ef |
|
BLAKE2b-256 | a35947c43902dbc0c6bda18b149c77d7ecc5a21a28b5edb449958ed2af20445e |