Skip to content

Instantly share code, notes, and snippets.

@zahash
Created December 28, 2018 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zahash/0aa4a7c1963025fab9c9ff4018b1f23b to your computer and use it in GitHub Desktop.
Save zahash/0aa4a7c1963025fab9c9ff4018b1f23b to your computer and use it in GitHub Desktop.
def time_it(func):
def wrapper(*args, **kwargs):
start = time.time()
func(*args, **kwargs)
end = time.time()
return (end - start)*1000
return wrapper
@zahash
Copy link
Author

zahash commented Dec 28, 2018

decorator function to calculate the execution time of any function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment