Skip to content

docs: improve timeit autorange description#144825

Open
scop wants to merge 1 commit intopython:mainfrom
scop:doc/timeit-autorange-repetition
Open

docs: improve timeit autorange description#144825
scop wants to merge 1 commit intopython:mainfrom
scop:doc/timeit-autorange-repetition

Conversation

@scop
Copy link
Contributor

@scop scop commented Feb 14, 2026

It not only determines but actually runs timeit a number of times. Also be more concise; the original form said basically the same thing twice.


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

@bedevere-app bedevere-app bot added awaiting review docs Documentation in the Doc dir skip news labels Feb 14, 2026
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Feb 14, 2026
@scop scop force-pushed the doc/timeit-autorange-repetition branch from 0a0889d to e2d6e7a Compare February 14, 2026 19:52
@scop scop changed the title docs: make timeit autorange description more concise docs: improve timeit autorange description Feb 14, 2026
It not only determines but actually runs timeit a number of times. Also
be more concise; the original form said basically the same thing twice.
@scop scop force-pushed the doc/timeit-autorange-repetition branch from e2d6e7a to 06df2b1 Compare February 14, 2026 19:54
Copy link
Contributor

@bkap123 bkap123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few small changes to try to make it clearer that the number of iterations increases until it takes long enough.

.. method:: Timer.autorange(callback=None)

Automatically determine how many times to call :meth:`.timeit`.
Call :meth:`.timeit` automatically determined number of times.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Call :meth:`.timeit` automatically determined number of times.
Call :meth:`.timeit` an automatically determined number of times.

Automatically determine how many times to call :meth:`.timeit`.
Call :meth:`.timeit` automatically determined number of times.

This is a convenience function that calls :meth:`.timeit` repeatedly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is a convenience function that calls :meth:`.timeit` repeatedly
This is a convenience function that repeatedly calls :meth:`.timeit`

(number of loops, time taken for that number of loops). It calls
:meth:`.timeit` with increasing numbers from the sequence 1, 2, 5,
10, 20, 50, ... until the time taken is at least 0.2 seconds.
with increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ...
with an increasing amount of iterations from the sequence 1, 2, 5, 10, 20, 50, ...

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

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants

Comments