Clean timer system for python application.
Project description
Kleen-Timer
Simple python library that handle execution time of a script and display the result in many way.
Table of contents
Installation
You can install the module via pip :
pip install kleentimer
or via wheel file From PyPi :
pip install wheel
python -m wheel install wheel_file.whl
Documentation
The aim of kleentimer is to make it simple for the user to get a script made timer.
First import it to your script :
from kleentimer import kleentimer
Then you can setup the format that will be displayed at the end of the execution :
- You got three usable variables (those are not mandatory, you can print only secondes and minutes and all possibility like that)
- hours
- minutes
- secondes
kleentimer.init_timer("The script run for {hours}h {minutes}min and {secondes}sec")
When you want to set the start of your script you can use the function start_timer()
kleentimer.start_timer()
And when you want to stop the timer simply call end_timer()
kleentimer.end_timer()
Then the function elapsed_time() return the string formatted with the right formatting
output = kleentimer.elapsed_time()
print(output)
>> The script run for 0h 10min and 20sec
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
Built Distribution
Hashes for KleenTimer-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0354d44d48e21afd9e1b32cd87ef87a12633deea4c44ce4cac916bd4bbaca8c1 |
|
MD5 | 16558d53cd6706cca77e5b3c5c38ef1b |
|
BLAKE2b-256 | a72170ca488fcb99f4d8232ced54991b229dfb9ffe2e9cc3789ed6cccf7d558f |