diff -r d9c98730e2e8 Doc/library/timeit.rst --- a/Doc/library/timeit.rst Sat Jul 07 13:34:50 2012 +1000 +++ b/Doc/library/timeit.rst Sat Jul 07 12:49:43 2012 +0200 @@ -31,6 +31,8 @@ may also contain multiple statements separated by ``;`` or newlines, as long as they don't contain multi-line string literals. + The execution time of *setup* is excluded from the overall timed execution run. + To measure the execution time of the first statement, use the :meth:`timeit` method. The :meth:`repeat` method is a convenience to call :meth:`timeit` multiple times and return a list of results. diff -r d9c98730e2e8 Lib/timeit.py --- a/Lib/timeit.py Sat Jul 07 13:34:50 2012 +1000 +++ b/Lib/timeit.py Sat Jul 07 12:49:43 2012 +0200 @@ -14,7 +14,8 @@ 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 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)