繁体   English   中英

AttributeError:未找到模块“时间”没有属性“时钟”

[英]AttributeError: not found module 'time' has no attribute 'clock'

Traceback (most recent call last):
  File "D:\Mata Kuliah\Semester VI\Bahan Sistem Tersebar\concurrent_futures_pooling.py", line 20, in <module>   
    start_time = time.clock()
AttributeError: module 'time' has no attribute 'clock'

time内置模块在 Python 3.8 中确实没有clock()导出。

您需要调整您的(显然是 Python 2 或 3.x(其中 x < 8)兼容)代码以与 Python 3.8 兼容。

time.clock()通常用于高分辨率“秒表”计时。 Python 3.3+ 中的替换是time.perf_counter()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM