bai*_*ang 5 python time timing python-3.x
这可能是一个愚蠢/明显的问题,但只是想确保我的预感是正确的.
我正在使用time.perf_counter()在Python3脚本中执行一些基本的性能计时,如下所示:
start = time.perf_counter()
# some time consuming operation here
end = time.perf_counter()
elapsed = end - start
Run Code Online (Sandbox Code Playgroud)
我会得到像9.774或36.903这样的值(当然还有更多的小数位).我假设数字越大=时间越长,但这些数字到底意味着什么呢?例如,1.23小秒仅1秒和0.23分秒
| 归档时间: |
|
| 查看次数: |
2225 次 |
| 最近记录: |