Last active
December 14, 2015 20:38
-
-
Save snahor/5144760 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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