summaryrefslogtreecommitdiffstats
path: root/Doc/library/timeit.rst
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-03-17 20:54:50 (GMT)
committerRobert Collins <rbtcollins@hp.com>2015-03-17 20:54:50 (GMT)
commit302dbc6792895de98ab14b382e7a35f512396ac7 (patch)
tree9c83183ef5b8dc84fa2d29b15b6ef3e3beb726c3 /Doc/library/timeit.rst
parentf024d263b4af789af0eb3727417bbeec582f69eb (diff)
downloadcpython-302dbc6792895de98ab14b382e7a35f512396ac7.zip
cpython-302dbc6792895de98ab14b382e7a35f512396ac7.tar.gz
cpython-302dbc6792895de98ab14b382e7a35f512396ac7.tar.bz2
Issue #18983: Allow selection of output units in timeit.
This allows manual selection of a specific unit such as usecs rather than the use of a heuristic. This is intended to aid machine processing of timeit output. Patch by Serhiy Storchaka.
Diffstat (limited to 'Doc/library/timeit.rst')
-rw-r--r--Doc/library/timeit.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst
index 17588bd..3ef9f3e 100644
--- a/Doc/library/timeit.rst
+++ b/Doc/library/timeit.rst
@@ -179,7 +179,7 @@ Command-Line Interface
When called as a program from the command line, the following form is used::
- python -m timeit [-n N] [-r N] [-s S] [-t] [-c] [-h] [statement ...]
+ python -m timeit [-n N] [-r N] [-u U] [-s S] [-t] [-c] [-h] [statement ...]
Where the following options are understood:
@@ -208,6 +208,12 @@ Where the following options are understood:
use :func:`time.time` (deprecated)
+.. cmdoption:: -u, --unit=U
+
+ specify a time unit for timer output; can select usec, msec, or sec
+
+ .. versionadded:: 3.5
+
.. cmdoption:: -c, --clock
use :func:`time.clock` (deprecated)