Skip to content

Instantly share code, notes, and snippets.

@dbrgn
Created April 8, 2011 07:32
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 dbrgn/909434 to your computer and use it in GitHub Desktop.
Save dbrgn/909434 to your computer and use it in GitHub Desktop.
Time python functions
def time(f):
"""Wrapper function to time python callables."""
import datetime
d = datetime.datetime.today()
print 'Timing callable %s' % f.__name__
print '------------------'
f()
print '------------------'
print datetime.datetime.today() - d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment