错误module ‘time’ has no attribute ‘clock’ 解决方法

python 报错:

AttributeError module ‘time’ has no attribute ‘clock’

原因:python3.8不支持clock

解决方法:


time.clock() 替换成 time.perf_counter()