Skip to main content

Clean timer system for python application.

Project description

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 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

KleenTimer-0.1.3.tar.gz (2.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page