python 的 time.clock() 无法使用的解决办法

作者:Administrator 发布时间: 2022-02-21 阅读量:1

今天在使用python的time模块时,发现clock()无法使用,报错信息:

原因:Python3.8不再支持time.clock,但在调用时依然包含该方法

解决办法:用time.perf_counter()替换