src/pylib/Lib/timeit

Source   Edit  

Vars

default_timer = pysince(3.3, perf_counter, default_timer)
Source   Edit  

Consts

default_repeat = 5
since python 3.7: default value of repeat parameter is changed from 3 to 5. Source   Edit  
TimeItUseTime {.booldefine: "timeit.usetime".} = true
disable this if don't wanna depending on Lib/time Source   Edit  

Procs

Templates

template autorange(self: Timer; callable = None): (int, float)
Admonition: since Python 3.6
Source   Edit  
template repeat(self: Timer; repeat = pysince(3.7, 5, 3);
                number = default_number): PyList[float]
Source   Edit  
template repeat(stmt: TimeitParam = NullStmt; setup: TimeitParam = NullStmt;
                timer = default_timer; repeat = pysince(3.7, 5, 3);
                number = default_number): PyList[float]

Example:

assert len(repeat(repeat=0)) == 0
Source   Edit