报错源码:
import time
# active the time clock
start = time.clock()
# here is the code need to test running time
# calculate the time between start and end
end = time.clock()
print('运行时间 : %s 秒' %(end-start))
报错内容:AttributeError module ‘time’ has no attribute ‘clock’
报错原因:python3.8不再支持clock了
解决方法:用time.pref_counter()
替换clock()
就好了