【发布时间】:2019-10-28 23:31:23
【问题描述】:
在 python 中测量函数持续时间的建议方法是什么?我看到了以下内容:
t0 = time.time()
# do something()
duration = time.time() - t0
和
t0 = time.perf_counter()
# do something()
duration = time.perf_counter() - t0
有什么区别,哪些应该用于分析?
【问题讨论】:
-
This 可能会有所帮助。
标签: python