Indicates the number of repetitions, the number of repetitions is used to determine the average value. For instance:
%timeit -n 250 a = 2
The number of executions will be n * r , but statistics are based on the number of repeats ( r ), but the number of "cycles" for each repetition is determined based on number ( n ).
Basically you need a sufficiently large n , so the minimum number of cycles is accurate “enough” to represent the maximum possible runtime, but you also need a sufficiently large r to get accurate “statistics” on how reliable the measurement of the “maximum possible runtime” is (especially if you suspect some caching might happen).
For shallow timings you should always use r 3 , 5 or 7 (in most cases large enough) and choose n as high as possible - but not too high, you probably want it to finish in a reasonable amount of time :-)
source share