Skip to content

Vemundss/ctimeit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ctimeit

A timeit decorator for python functions

Installation:

pip install ctimeit

Example Usage:

Replaces the following code:

from timeit import default_timer as timer

def my_example_func(*args,**kwargs):
  """do some calculations and store in result"""
  return result

start = timer()
output = my_func(*args, **kwargs)
end = timer()

useful_info_str = "It took this many seconds"
print(useful_info_str, end-start)

With:

from ctimeit import ctimeit

@ctimeit
def my_example_func(*args,**kwargs):
  """do some calculations and store in result"""
  return result

Links to Project

Github link: https://github.com/Vemundss/ctimeit

PyPi link: https://pypi.org/project/ctimeit/

About

A timeit decorator for python functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages