Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import contextlib
- import time
- @contextlib.contextmanager
- def profile(caption = None):
- bef = time.time()
- yield
- aft = time.time()
- diff = aft - bef
- print "***", "profile", caption, diff * 1000.0, "ms"
Add Comment
Please, Sign In to add comment