classification
Title: timeit CLI best of 3: undocumented output format
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, hachat, hugovk, iritkatriel, miss-islington, r.david.murray, rbcollins
Priority: normal Keywords: easy, patch

Created on 2015-01-07 08:53 by hachat, last changed 2022-01-14 17:55 by iritkatriel. This issue is now closed.

Files
File name Uploaded Description Edit
issue-23183-1.patch rbcollins, 2015-03-17 21:25 review
Pull Requests
URL Status Linked Edit
PR 30359 merged hugovk, 2022-01-03 15:27
PR 30603 merged miss-islington, 2022-01-14 17:26
PR 30604 merged miss-islington, 2022-01-14 17:26
Messages (7)
msg233570 - (view) Author: Chathuranga (hachat) Date: 2015-01-07 08:53
easy

Following command is executed in terminal to use timeit module to measure time.

python -m timeit -v -n 3 "time.sleep(1)"

Output of the command:
raw times: 3 3 3
3 loops, best of 3: 1 sec per loop

The interpretation of this output is unclear, and no details available in the documentation.
https://docs.python.org/2/library/timeit.html#command-line-interface
msg238340 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2015-03-17 21:25
Here is a patch with some prose - feedback appreciated!
msg273526 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-08-24 00:52
I think the use of "timing loop" is very confusing, since the word 'loop' refers to one execution of the statement body in the actual output text.  What about calling it a 'timing run'?
 
It looks like whatever we come up with should be applied to 3.5 and 3.6 as well.
msg407506 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-12-01 23:48
The patch needs to be converted to a GitHub PR.
msg410572 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-14 17:25
New changeset 73140de97cbeb01bb6c9af1da89ecb9355921e91 by Hugo van Kemenade in branch 'main':
bpo-23183: Document the timeit output (GH-30359)
https://github.com/python/cpython/commit/73140de97cbeb01bb6c9af1da89ecb9355921e91
msg410576 - (view) Author: miss-islington (miss-islington) Date: 2022-01-14 17:47
New changeset 26039d1e0a1da897d28688895126eb8bbd16f2c9 by Miss Islington (bot) in branch '3.10':
bpo-23183: Document the timeit output (GH-30359)
https://github.com/python/cpython/commit/26039d1e0a1da897d28688895126eb8bbd16f2c9
msg410578 - (view) Author: miss-islington (miss-islington) Date: 2022-01-14 17:53
New changeset 9badf6895a9bc1b01b2d6b2fb35419e7c5523ce6 by Miss Islington (bot) in branch '3.9':
bpo-23183: Document the timeit output (GH-30359)
https://github.com/python/cpython/commit/9badf6895a9bc1b01b2d6b2fb35419e7c5523ce6
History
Date User Action Args
2022-01-14 17:55:52iritkatrielsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-01-14 17:53:49miss-islingtonsetmessages: + msg410578
2022-01-14 17:47:59miss-islingtonsetmessages: + msg410576
2022-01-14 17:26:41miss-islingtonsetpull_requests: + pull_request28803
2022-01-14 17:26:35miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request28802
2022-01-14 17:25:52iritkatrielsetmessages: + msg410572
2022-01-03 15:27:08hugovksetkeywords: + patch
nosy: + hugovk

pull_requests: + pull_request28573
stage: needs patch -> patch review
2021-12-01 23:48:38iritkatrielsetkeywords: + easy, - patch
nosy: + iritkatriel
messages: + msg407506

2021-12-01 23:48:08iritkatrielsetversions: + Python 3.9, Python 3.10, Python 3.11, - Python 2.7, Python 3.5, Python 3.6
2016-08-24 00:52:30r.david.murraysetversions: + Python 3.5, Python 3.6
nosy: + r.david.murray

messages: + msg273526

stage: commit review -> needs patch
2015-08-26 00:42:15rbcollinssetstage: patch review -> commit review
2015-03-17 21:25:40rbcollinssetstage: patch review
2015-03-17 21:25:27rbcollinssetfiles: + issue-23183-1.patch
keywords: + patch
messages: + msg238340
2015-03-17 21:24:45rbcollinssetnosy: + rbcollins
2015-01-07 08:53:19hachatcreate