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

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: I think Caleb's "sample_before_and_after" idea hints that this may be an idea that could benefit from the ExitStack treatment where contextlib provides a building block that handles the interaction with the context management machinery, with the documentation

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

2019-03-25 Thread Caleb Hattingh
Caleb Hattingh added the comment: Somehow I missed that there's been an open issue on this. Like others I've written a bunch of different incarnations of an "elapsed" context manager over the years. Always for the more crude "how long did this take" reason like David mentioned, never the

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

2018-02-10 Thread Xavier G. Domingo
Change by Xavier G. Domingo : -- nosy: +xgdomingo ___ Python tracker ___ ___

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

2018-01-30 Thread R. David Murray
R. David Murray 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

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

2018-01-30 Thread Cheryl Sabella
Cheryl Sabella added the comment: Hello everyone, I was interested in similar functionality for timeit and found this discussion. I know it's too late for 3.7, but I was wondering if it would be worth putting this on python-ideas or python-dev to try to get some consensus

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

2017-05-20 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___

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

2017-05-20 Thread irdb
Changes by irdb : -- nosy: +irdb ___ Python tracker ___ ___ Python-bugs-list mailing

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

2015-03-17 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19495 ___ ___ Python-bugs-list

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

2015-03-17 Thread Robert Collins
Changes by Robert Collins robe...@robertcollins.net: -- nosy: +rbcollins title: Enhancement for timeit: measure time to run blocks of code using 'with' - context manager for measuring duration of blocks of code ___ Python tracker