STINNER Victor added the comment:

Serhiy Storchaka:
> This is a senseless example. 0.0339 usec is not a time of executing "pass", 
> it is an overhead of the iteration. You can't use timeit for measuring the 
> performance of the code that takes such small time. You just can't get the 
> reliable result for it. Even for code that takes an order larger time the 
> result is not very reliable. Thus no need to worry about timing much less 
> than 1 usec.

I will not argue about the reliability of the timeit module.

It's common to see code snippets using timeit for short
microbenchmarks taking less than 1 us, especially on
micro-optimization on CPython.


Python tracker <>
Python-bugs-list mailing list

Reply via email to