Skip to content

Commit

Permalink
bpo-40419: timeit CLI docs now mention 1,2,5,10,... trials instead of…
Browse files Browse the repository at this point in the history
… powers of 10 (GH-19752)
  • Loading branch information
sjvrijn committed May 2, 2020
1 parent b7226eb commit 7663523
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Doc/library/timeit.rst
Expand Up @@ -251,7 +251,8 @@ quotes and using leading spaces. Multiple :option:`-s` options are treated
similarly.

If :option:`-n` is not given, a suitable number of loops is calculated by trying
successive powers of 10 until the total time is at least 0.2 seconds.
increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the total
time is at least 0.2 seconds.

:func:`default_timer` measurements can be affected by other programs running on
the same machine, so the best thing to do when accurate timing is necessary is
Expand Down
3 changes: 2 additions & 1 deletion Lib/timeit.py
Expand Up @@ -29,7 +29,8 @@
treated similarly.
If -n is not given, a suitable number of loops is calculated by trying
successive powers of 10 until the total time is at least 0.2 seconds.
increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the
total time is at least 0.2 seconds.
Note: there is a certain baseline overhead associated with executing a
pass statement. It differs between versions. The code here doesn't try
Expand Down

0 comments on commit 7663523

Please sign in to comment.