How to interpret the returned timeit string

Following:

timeit print("foo")

returns something like: 100000 loops, best of 3: 2.35 ยตs per loop. I believe that 100000refers to the argument number timeit. I do not understand what it means best of 3, and what unit of time is used? In this case, it's probably a microsecond, but I also saw usand nsas a unit; however, I could not find an explanation in the documentation.

+4
source share
1 answer

I assume you are talking about the command line interface here.

; 10 , 10 , 0,2 . 10000 , , 0.2 .

3 - ; , --repeat - 3. 3.

. , , , , . 1000 1000 , sec, msec usec .

IPython %timeit , s, ms, us ns, , , us ยตs, .

Python 3.4 iPython implentation ( , _format_time().

+6

All Articles