Skip to content

Instantly share code, notes, and snippets.

@atiaxi
Created June 10, 2015 17:51
Show Gist options
  • Save atiaxi/04ed3a5c6b4190ac9cdd to your computer and use it in GitHub Desktop.
Save atiaxi/04ed3a5c6b4190ac9cdd to your computer and use it in GitHub Desktop.
@contextmanager
def timeit(event)
atime = time.time()
yield
btime = time.time()
logger.debug("%s took %d" % (event, btime-atime))
with timeit("EmailAddressClaimantHistory"):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment