Permalink
Browse files

Merge pull request #25 from elpres/master

Allow context manager invocation to suppress output
  • Loading branch information...
2 parents 52a6a7a + 8086b52 commit 1a33eba91899afe17a8b752c6dfdec6f05dd0c01 @durin42 durin42 committed Oct 15, 2015
Showing with 3 additions and 2 deletions.
  1. +3 −2 statprof.py
View
@@ -286,13 +286,14 @@ def reset(frequency=None):
@contextmanager
-def profile():
+def profile(verbose=True):
start()
try:
yield
finally:
stop()
- display()
+ if verbose:
+ display()
###########################################################################

0 comments on commit 1a33eba

Please sign in to comment.