[issue19495] Enhancement for timeit: measure time to run blocks of code using 'with'

Steven D'Aprano report at bugs.python.org
Mon Jun 16 04:55:24 CEST 2014


Steven D'Aprano added the comment:

On Mon, Jun 16, 2014 at 02:09:22AM +0000, Raymond Hettinger wrote:

> Perhaps a time-elapsed context manager would be a better fit in the 
> contextlib module (which contains more general purpose macro-level 
> tools usable for many different tasks) rather than the timeit module 
> (which is more narrowly tailored to high-quality reproducable in-vitro 
> performance analysis at a fine-grained level).

Perhaps you're right, but "timeit" is a fairly broad description, and I 
would expect anything related to the task "time it" to be found there. 
I'm +0.9 on timeit and +0.4 on contextlib.

Does anyone else have an opinion on where this belongs?

----------

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


More information about the Python-bugs-list mailing list