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

Uploaded Source

File details

Details for the file KleenTimer-0.1.3.tar.gz.

File metadata

  • Download URL: KleenTimer-0.1.3.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2

File hashes

Hashes for KleenTimer-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1690763b9997b9613fca4fe342f988d3549e6ebdca26a713163b70cb4c6a639c
MD5 5c7a7a1d33aad30bcac1ed2592c1bc07
BLAKE2b-256 5a525cae496574d137d4450c705d3fbe6ef67bf25d69a5891af7c7b3e8cea295

See more details on using hashes here.

Supported by

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