tictactoc
Project description
tictactoc
A simple library to be able to control the time that certain parts of the code take
Installation and use
To install this module use:
pip install tictactoc
Run tests to validate:
tictactoc-tests
Usage
Basic use, start and end.
from tictactoc import tictactoc
tictactoc.tic() # Start
print(tictactoc.toc()) # Finish
Using tac in loops. We can do a tac in each iteration. When we finnish the loop, we do a toc skipping this time.
from time import sleep
from tictactoc import tictactoc
tictactoc.tic("my loop")
my_loop=[1,2]
for element in my_loop:
sleep(0.1)
tictactoc.tac("my loop")
result = tictactoc.toc("my loop", skip_toc=True)
print(f"total: {result["total"]}, each iteration: {', '.join(map(str,result["steps"]))}")
Credits
Developed and maintained by felipem775. Contributions are welcomed.
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
tictactoc-0.2.0.tar.gz
(2.5 kB
view details)
Built Distribution
File details
Details for the file tictactoc-0.2.0.tar.gz
.
File metadata
- Download URL: tictactoc-0.2.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 335897fa0de371d35942d66853cc473110fe307d5f8af28ba3ed21c647bdad58 |
|
MD5 | c0e4dc4b9a6d580ab0007e82d314a41b |
|
BLAKE2b-256 | 94530455648a2c202b8e20cde85337704727492fd766ea410aa8539278c59c14 |
File details
Details for the file tictactoc-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: tictactoc-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b98379fdde104d14d9b50bcbef6dd3f430034c0196c1db86231d398527b02a3e |
|
MD5 | 76f3d93127011687255ffbd9b3d8d4b5 |
|
BLAKE2b-256 | abc63f2b809d67090e3a00a61a59cc81d849dc015d4faebf507d5a6d536ffe25 |