Skip to content

Instantly share code, notes, and snippets.

@Velrok
Created January 21, 2013 20:34
Show Gist options
  • Save Velrok/4589075 to your computer and use it in GitHub Desktop.
Save Velrok/4589075 to your computer and use it in GitHub Desktop.
import time
def timeit(method):
def timed(*args, **kw):
ts = time.time()
result = method(*args, **kw)
te = time.time()
print '%r (%r, %r) %2.2f sec' % \
(method.__name__, args, kw, te-ts)
return result
return timed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment