update to avoid time.clock (deprecated)

This commit is contained in:
Remzi Arpaci-Dusseau 2020-06-11 13:55:42 -05:00
parent 57bd1b7483
commit 681c8dad20
2 changed files with 22 additions and 4 deletions

View File

@ -14,6 +14,13 @@ def random_seed(seed):
random.seed(seed)
return
def time_clock():
try:
rc = time_clock()
except:
rc = time.process_time()
return rc
#
# HELPER
#
@ -981,9 +988,11 @@ for t in range(numthreads):
procs.restore()
# run it
t1 = time.clock()
if printstats:
t1 = time_clock()
ic = cpu.run(procs, intfreq, intrand)
t2 = time.clock()
if printstats:
t2 = time_clock()
if printstats:
print('')

View File

@ -14,6 +14,13 @@ def random_seed(seed):
random.seed(seed)
return
def time_clock():
try:
rc = time_clock()
except:
rc = time.process_time()
return rc
#
# HELPER
#
@ -1179,9 +1186,11 @@ for t in range(numthreads):
procs.finalize(procsched)
# run it
t1 = time.clock()
if printstats:
t1 = time_clock()
ic = cpu.run(procs, intfreq, intrand)
t2 = time.clock()
if printstats:
t2 = time_clock()
if printstats:
print('')