hugovk · GitHub

Feature or enhancement

Proposal:

Taking inspiration from CLI tools such as hyperfine:

Image Image

Let's add colour to the CLI output of python -m timeit.

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.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Read the original on github.com ↗