Skip to content

Instantly share code, notes, and snippets.

@winogradoff
Created April 21, 2016 18:45
Show Gist options
  • Save winogradoff/8ea1372676bdc6b3a59a86d79a0a5f64 to your computer and use it in GitHub Desktop.
Save winogradoff/8ea1372676bdc6b3a59a86d79a0a5f64 to your computer and use it in GitHub Desktop.
Python timit decorator
def timeit(f):
def timed(*args, **kw):
ts = time.time()
result = f(*args, **kw)
te = time.time()
print("function time {} : {} sec".format(f.__name__, te - ts))
return result
return timed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment