[docs] [issue18588] timeit examples should be consistent
report at bugs.python.org
Sun Jun 29 11:12:09 CEST 2014
Ezio Melotti added the comment:
I tried to run those timings again and the values I got from the terminal are close to the ones I got from the interactive interpreter.
I'm not sure why when I wrote those examples I got such different values.
It would be fine with me to update them and avoid confusion.
> In command-line invocation the gc is disabled.
> And timit.repeat() is used instead of timit.timit().
Looking at the current code it seems to me that the command-line uses timeit.repeat(), that repeat calls timeit.timeit(), and that timeit.timeit() disables the gc. Maybe back then it was different; that would explain why I got different results.
Python tracker <report at bugs.python.org>
More information about the docs