[issue19495] context manager for measuring duration of blocks of code

R. David Murray report at bugs.python.org
Tue Jan 30 15:06:51 EST 2018


R. David Murray <rdmurray at bitdance.com> added the comment:

FWIW, we just ran in to the need for this on our project, and used 'Time' from the contexttimer package on pypi.  In our use case we want the number so we can log it, and what we care about is the actual elapsed time, not a precise measurement of the code block, because it for system monitoring and metrics, not hardcore performance analysis.  

Having this always print would indeed be sub-optimal :)

----------
nosy: +r.david.murray
versions: +Python 3.8 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19495>
_______________________________________


More information about the Python-bugs-list mailing list