Message241643
The docs for the timeit command line interface specify
If -n is not given, a suitable number of loops is calculated by trying successive powers of 10 until the total time is at least 0.2 seconds.
This sounds as if it it first tries 1, then 10, then 100 etc. But the code starts with 10 iterations. So even if the tested code already takes long enough (e.g. because it is a suitable loop itself), timit will by default test 10 loops.
I propose to change that, and replace
# determine number so that 0.2 <= total time < 2.0
for i in range(1, 10):
number = 10**i
with
# determine number so that 0.2 <= total time < 2.0
for i in range(0, 10):
number = 10**i
in Lib/timeit.py. |
|
Date |
User |
Action |
Args |
2015-04-20 13:28:04 | nomeata | set | recipients:
+ nomeata |
2015-04-20 13:28:04 | nomeata | set | messageid: <1429536484.03.0.469371276206.issue24015@psf.upfronthosting.co.za> |
2015-04-20 13:28:03 | nomeata | link | issue24015 messages |
2015-04-20 13:28:03 | nomeata | create | |
|