Skip to content

A timer that easily integrates with functions and code chunks

License

Notifications You must be signed in to change notification settings

manifoldai/eztime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

eztime

A timer that easily integrates with functions and code chunks. Use it to log the time elapsed of any function or code chunk.

Current version == 0.0.3

Original code source: Ray https://stackoverflow.com/questions/5478351/python-time-measure-function

Installation:

$ pip install eztime # first time installation

$ pip install -U eztime # upgrade to latest version

Easily integrates into your code

Decorate your functions

@time_func
def foo(barx, bary=3):
    return barx * bary
    
foo(3, bary=3)

Call it as a wrapper around your functions

def foo(barx, bary=3):
    return barx * bary
    
time_func(foo)(3, bary=3)

Write any code chunk using with:

with time_chunk('My timed hello world'):
    print('Hello World')

About

A timer that easily integrates with functions and code chunks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages