[英]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'
The time
built-in module indeed doesn't have a clock()
export in Python 3.8. time
内置模块在 Python 3.8 中确实没有clock()
导出。
You'll need to adapt your (apparently Python 2 or 3.x (where x < 8) compatible) code to be compatible with Python 3.8.您需要调整您的(显然是 Python 2 或 3.x(其中 x < 8)兼容)代码以与 Python 3.8 兼容。
time.clock()
was generally used for high-resolution "stopwatch" timing. time.clock()
通常用于高分辨率“秒表”计时。 The replacement in Python 3.3+ is time.perf_counter()
. Python 3.3+ 中的替换是
time.perf_counter()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.