Skip to content

benhymans/btimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

btimer

A simple and useful code timer for python.

Originally intended for web apps and batch jobs, btimer offers a simple timing solution implemented with minimal code.

Created by Ben Hymans in 2023.

MIT License

Install

pip install git+https://github.com/benhymans/btimer.git

Example Usage

from btimer import Timer

    t1 = Timer() # Timer starts automatically
    # Code to be timed
    t1.seconds # Returns the elapsed time in seconds
    
    t2 = Timer("Task2", 4) # Timer name and precision are optional
    # Code to be timed
    t2.minutes # Available units: milliseconds, seconds, minutes, and hours

    print(t1) # Returns a string of the elapsed time in seconds with timer name

About

A simple and useful code timer for python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages