Kaydet (Commit) 2aebd4a8 authored tarafından Guido van Rossum's avatar Guido van Rossum

Replace deprecated time.clock() with time.time(). Fixes issue #20475.

üst 9661efe6
...@@ -41,7 +41,7 @@ Version History: ...@@ -41,7 +41,7 @@ Version History:
LOOPS = 50000 LOOPS = 50000
from time import clock from time import time
__version__ = "1.2" __version__ = "1.2"
...@@ -93,10 +93,10 @@ def Proc0(loops=LOOPS): ...@@ -93,10 +93,10 @@ def Proc0(loops=LOOPS):
global PtrGlb global PtrGlb
global PtrGlbNext global PtrGlbNext
starttime = clock() starttime = time()
for i in range(loops): for i in range(loops):
pass pass
nulltime = clock() - starttime nulltime = time() - starttime
PtrGlbNext = Record() PtrGlbNext = Record()
PtrGlb = Record() PtrGlb = Record()
...@@ -108,7 +108,7 @@ def Proc0(loops=LOOPS): ...@@ -108,7 +108,7 @@ def Proc0(loops=LOOPS):
String1Loc = "DHRYSTONE PROGRAM, 1'ST STRING" String1Loc = "DHRYSTONE PROGRAM, 1'ST STRING"
Array2Glob[8][7] = 10 Array2Glob[8][7] = 10
starttime = clock() starttime = time()
for i in range(loops): for i in range(loops):
Proc5() Proc5()
...@@ -134,7 +134,7 @@ def Proc0(loops=LOOPS): ...@@ -134,7 +134,7 @@ def Proc0(loops=LOOPS):
IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1 IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1
IntLoc1 = Proc2(IntLoc1) IntLoc1 = Proc2(IntLoc1)
benchtime = clock() - starttime - nulltime benchtime = time() - starttime - nulltime
if benchtime == 0.0: if benchtime == 0.0:
loopsPerBenchtime = 0.0 loopsPerBenchtime = 0.0
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment