Skip to content

Improve %timeit documentation example with -n and -r options#15127

Open
zivkoss wants to merge 1 commit intoipython:mainfrom
zivkoss:fix/neca
Open

Improve %timeit documentation example with -n and -r options#15127
zivkoss wants to merge 1 commit intoipython:mainfrom
zivkoss:fix/neca

Conversation

@zivkoss
Copy link

@zivkoss zivkoss commented Feb 12, 2026

Description

Updated the %timeit documentation example to demonstrate how to control
both the number of runs (-r) and executions per run (-n) for more stable
timing results.

Changes

  • Added code example:
    %timeit -n5 -r3 sum(range(1000))
  • Clarified explanatory text around repeated measurements.

Why

Makes the docs more explicit for users learning about %%timeit and timing stability.

@zivkoss
Copy link
Author

zivkoss commented Feb 12, 2026

This PR improves the %timeit example and explanation for clarity.

@Carreau
Copy link
Member

Carreau commented Feb 18, 2026

This pull requests show no changes, did you commit / push correctly ?

@zivkoss
Copy link
Author

zivkoss commented Feb 19, 2026

I'll check it out, sorry if I missed something.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants