[issue6422] timeit called from within Python should allow autoranging

Nick Coghlan report at bugs.python.org
Tue Jun 26 14:37:40 CEST 2012


Nick Coghlan <ncoghlan at gmail.com> added the comment:

In #5442, I proposed leaving the architecture of the module alone, and simply exposing the main module functionality as a high level helper function:

def measure(stmt="pass", setup="pass", timer=default_timer,
            repeat=default_repeat, number=default_number,
            verbosity=0, precision=3)

The return value would simply be a (number, results) 2-tuple with the number of iterations per test (which may have been calculated automatically), and then a list of the results. To get "timeit" style behavior, simply set "repeat=1".

----------
nosy: +ncoghlan

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


More information about the Python-bugs-list mailing list