Skip to content

Instantly share code, notes, and snippets.

@tupy
Created January 23, 2013 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tupy/4610170 to your computer and use it in GitHub Desktop.
Save tupy/4610170 to your computer and use it in GitHub Desktop.
import functools
import time
def debug(func):
@functools.wraps(func)
def f(self, *args, **kwargs):
start = time.now()
_return = func(self, *args, **kwargs)
diff = time.now() - start
print '%s (%.2fms)' % (func, diff)
return _return
return f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment