Title: allow timeit to run expensive reset code per repeats
Type: enhancement Stage:
Components: Versions:
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: rbcollins
Priority: normal Keywords:

Created on 2015-03-17 00:47 by rbcollins, last changed 2015-03-17 23:28 by rbcollins. This issue is now closed.

Messages (2)
msg238252 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2015-03-17 00:47
I was timing some cold-cache operations today and had to not use timeit because I wanted to run some code between statement (flushing caches) that shouldn't be timed as part of statement. It would be nice, similarly to -s, to be able to say -i 'something run between statement repetitions'. That is - we run statement in a tight loop some N times, and then repeat that loop some R times, I'd like to run the -i code between the R repetitions, not inside the inner timing loop (since we run that to get timer resolution).
msg238360 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2015-03-17 23:28
bah, nevermind - I failed to get that setup is called once per loop regardless - I might consider this a doc issue, or perhaps I was just fuzzy brained.
Date User Action Args
2015-03-17 23:28:00rbcollinssetstatus: open -> closed
resolution: not a bug
messages: + msg238360
2015-03-17 00:47:44rbcollinscreate