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 <rep...@bugs.python.org>
<http://bugs.python.org/issue28240>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to