GithubHelp home page GithubHelp logo

kleentimer's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.