Taking inspiration from CLI tools such as hyperfine:
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))"
With a warning:
./python.exe -m timeit --verbose "import time, random; time.sleep(random.random() * 0.5)"
As usual, environment variables can control colour output.
This is a minor feature, which does not need previous discussion elsewhere
No response
gh-146609: Add colour to `timeit` CLI output (#146610)
pythongh-146609: Add colour to `timeit` CLI output (python#146610)
gh-146609: Use argparse for colour help timeit CLI (#149334)
Activity
gh-146609: Add colour to `timeit` CLI output (#146610)
pythongh-146609: Add colour to `timeit` CLI output (python#146610)
gh-146609: Use argparse for colour help timeit CLI (#149334)