[Python-checkins] cpython: Replace deprecated time.clock() with time.time(). Fixes issue #20475.

guido.van.rossum python-checkins at python.org
Wed Jun 4 20:45:07 CEST 2014


http://hg.python.org/cpython/rev/38acef3c3228
changeset:   91016:38acef3c3228
user:        Guido van Rossum <guido at python.org>
date:        Wed Jun 04 11:45:05 2014 -0700
summary:
  Replace deprecated time.clock() with time.time(). Fixes issue #20475.

files:
  Lib/test/pystone.py |  10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)


diff --git a/Lib/test/pystone.py b/Lib/test/pystone.py
--- a/Lib/test/pystone.py
+++ b/Lib/test/pystone.py
@@ -41,7 +41,7 @@
 
 LOOPS = 50000
 
-from time import clock
+from time import time
 
 __version__ = "1.2"
 
@@ -93,10 +93,10 @@
     global PtrGlb
     global PtrGlbNext
 
-    starttime = clock()
+    starttime = time()
     for i in range(loops):
         pass
-    nulltime = clock() - starttime
+    nulltime = time() - starttime
 
     PtrGlbNext = Record()
     PtrGlb = Record()
@@ -108,7 +108,7 @@
     String1Loc = "DHRYSTONE PROGRAM, 1'ST STRING"
     Array2Glob[8][7] = 10
 
-    starttime = clock()
+    starttime = time()
 
     for i in range(loops):
         Proc5()
@@ -134,7 +134,7 @@
         IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1
         IntLoc1 = Proc2(IntLoc1)
 
-    benchtime = clock() - starttime - nulltime
+    benchtime = time() - starttime - nulltime
     if benchtime == 0.0:
         loopsPerBenchtime = 0.0
     else:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list