Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
333518e0
Commit
333518e0
authored
Apr 21, 2015
by
Andrew Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#15183: clarify timeit documentation to say that setup statement isn't timed
parent
b6076fb1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
Doc/library/timeit.rst
Doc/library/timeit.rst
+2
-0
Lib/timeit.py
Lib/timeit.py
+2
-1
No files found.
Doc/library/timeit.rst
View file @
333518e0
...
...
@@ -94,6 +94,8 @@ The module defines three convenience functions and a public class:
method. The :meth:`.repeat` method is a convenience to call :meth:`.timeit`
multiple times and return a list of results.
The execution time of *setup* is excluded from the overall timed execution run.
The *stmt* and *setup* parameters can also take objects that are callable
without arguments. This will embed calls to them in a timer function that
will then be executed by :meth:`.timeit`. Note that the timing overhead is a
...
...
Lib/timeit.py
View file @
333518e0
...
...
@@ -14,7 +14,8 @@ Command line usage:
Options:
-n/--number N: how many times to execute 'statement' (default: see below)
-r/--repeat N: how many times to repeat the timer (default 3)
-s/--setup S: statement to be executed once initially (default 'pass')
-s/--setup S: statement to be executed once initially (default 'pass').
Execution time of this setup statement is NOT timed.
-p/--process: use time.process_time() (default is time.perf_counter())
-t/--time: use time.time() (deprecated)
-c/--clock: use time.clock() (deprecated)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment