In brief
timeit measures small code snippets repeatedly rather than relying on one incidental observation. Setup can be separated from the measured operation.
Useful to know
timeit measures small code snippets repeatedly rather than relying on one incidental observation. Setup can be separated from the measured operation. [1]
Record the version, input and what the interval includes. The fastest snippet in a tiny example is not automatically the best solution for a whole website. Networking, databases and realistic data volumes can change the dominant cost.
Sources
For further detail and to check the information: