Skip to content

Latest commit

 

History

History
70 lines (51 loc) · 1.92 KB

README.md

File metadata and controls

70 lines (51 loc) · 1.92 KB

GitHub license GitHub repo size GitHub repo size

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 02h 06min and 20sec