[Python-Dev] cpython: Issue #14428: Use the new time.perf_counter() and time.process_time() functions (original) (raw)
Georg Brandl g.brandl at gmx.net
Tue May 1 11:59:48 CEST 2012
- Previous message: [Python-Dev] cpython: Issue #14428: Use the new time.perf_counter() and time.process_time() functions
- Next message: [Python-Dev] cpython: Move make_key() out of the decorator body. Make keys that only need to be
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 01.05.2012 10:35, Victor Stinner wrote:
diff --git a/Lib/timeit.py b/Lib/timeit.py --- a/Lib/timeit.py +++ b/Lib/timeit.py @@ -15,8 +15,8 @@ -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') - -t/--time: use time.time() (default on Unix) - -c/--clock: use time.clock() (default on Windows) + -t/--time: use time.time() + -c/--clock: use time.clock()
Does it make sense to keep the options this way? IMO the distinction should be to use either perfcounter() or processtime(), and the options could implement this (-t -> perfcounter, -c -> processtime). You might need to use exactly the same clock to compare performance of Python 3.2 and 3.3. Adding an option to use time.processtime() is a good idea. Is anyone interested to implement it?
I implemented it in d43a8aa9dbef. I also updated the docs in 552c207f65e4.
Georg
- Previous message: [Python-Dev] cpython: Issue #14428: Use the new time.perf_counter() and time.process_time() functions
- Next message: [Python-Dev] cpython: Move make_key() out of the decorator body. Make keys that only need to be
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]