Skip to content

Instantly share code, notes, and snippets.

@snahor
Last active December 14, 2015 20:38
Show Gist options
  • Save snahor/5144760 to your computer and use it in GitHub Desktop.
Save snahor/5144760 to your computer and use it in GitHub Desktop.
def timeit(fn):
def time_fn(*arg, **kw):
import time
now = time.time()
fn(*arg, **kw)
total = time.time() - now
print "total time for %s: %d" % (fn.__name__, total)
return time_fn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment