summaryrefslogtreecommitdiffstats
path: root/Doc/includes
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-04-29 01:01:20 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-04-29 01:01:20 (GMT)
commitfe98e2fc8391607fc1cae235a49bbafc65a822f0 (patch)
treee00cb1f63634a8361ebd60c3a496a163e5d66c59 /Doc/includes
parent47620a661128ce91f46f01fb46e1326880365e75 (diff)
downloadcpython-fe98e2fc8391607fc1cae235a49bbafc65a822f0.zip
cpython-fe98e2fc8391607fc1cae235a49bbafc65a822f0.tar.gz
cpython-fe98e2fc8391607fc1cae235a49bbafc65a822f0.tar.bz2
Issue #14428: Use the new time.perf_counter() and time.process_time() functions
* Replace "time.clock on windows, or time.time" with time.perf_counter() * profile module: only use time.process_time() instead of trying different functions providing the process time * timeit module: use time.perf_counter() by default, time.time() and time.clock() can still be used using --time and --clock options * pybench program: use time.perf_counter() by default, add support for the new time.process_time() and time.perf_counter() functions, but stay backward compatible. Use also time.get_clock_info() to display information of the timer.
Diffstat (limited to 'Doc/includes')
-rw-r--r--Doc/includes/mp_benchmarks.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/Doc/includes/mp_benchmarks.py b/Doc/includes/mp_benchmarks.py
index acdf642..3763ea9 100644
--- a/Doc/includes/mp_benchmarks.py
+++ b/Doc/includes/mp_benchmarks.py
@@ -6,16 +6,12 @@
#
import time
-import sys
import multiprocessing
import threading
import queue
import gc
-if sys.platform == 'win32':
- _timer = time.clock
-else:
- _timer = time.time
+_timer = time.perf_counter
delta = 1