Skip to content

Instantly share code, notes, and snippets.

@GeorgeErickson
Created November 10, 2011 15:56
Show Gist options
  • Save GeorgeErickson/1355199 to your computer and use it in GitHub Desktop.
Save GeorgeErickson/1355199 to your computer and use it in GitHub Desktop.
useful python snippets
import time
def log_timing(func):
def wrapper(*arg):
t1 = time.time()
res = func(*arg)
t2 = time.time()
print "%s took %d ms" % (func.func_name, (t2-t1)*1000.0)
return res
return wrapper
def max_memory(func):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment