Skip to content

gh-146609: Add colour to timeit CLI output#146610

Open
hugovk wants to merge 3 commits intopython:mainfrom
hugovk:3.15-timeit-colour
Open

gh-146609: Add colour to timeit CLI output#146610
hugovk wants to merge 3 commits intopython:mainfrom
hugovk:3.15-timeit-colour

Conversation

@hugovk
Copy link
Copy Markdown
Member

@hugovk hugovk commented Mar 29, 2026

Standard and verbose:

./python.exe -m timeit "'-'.join(str(n) for n in range(100))"
./python.exe -m timeit --verbose "'-'.join(str(n) for n in range(100))"
image

With a warning:

./python.exe -m timeit --verbose "import time, random; time.sleep(random.random() * 0.5)"
image

As usual, environment variables can control colour output.


📚 Documentation preview 📚: https://cpython-previews--146610.org.readthedocs.build/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant