timeit — Measure execution time of small code snippets — Python 3.16.0a0 documentation

docs.python.org

Table of Contents | pstats — Statistics for profilers | Report a bug | Improve this page | index | modules | Python | 3.16.0a0 Documentation | The Python Standard Library | Debugging and profiling | trace — Trace or track Python statement executio

Tin mới

pstats — Statistics for profilers

trace — Trace or track Python statement execution

Python Module Index

3.16.0a0 Documentation

The Python Standard Library

Debugging and profiling

time.perf_counter()

Changed in version 3.3: time.perf_counter() is now the default timer.

garbage collection

By default, timeit() temporarily turns off garbage collection during the timing. The advantage of this approach is that it makes independent timings more comparable. The disadvantage is that GC may be an important compon

controlled using environment variables

Added in version 3.15: Output is in color by default and can be controlled using environment variables.

1 1