【发布时间】:2011-05-26 04:34:37
【问题描述】:
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 65.417 65.417 <string>:1(<module>)
1 43.675 43.675 65.417 65.417 primenumber_o.py:3(main)
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
99999 21.742 0.000 21.742 0.000 {range}
2 0.000 0.000 0.000 0.000 {time.time}
具体来说,第三行。我阅读了 cProfile,但没有解释该行的含义。它也没有提供我可以在 Google 上搜索的任何关键字,所以我很难过。
我正在分析的 Python 脚本找到素数。
我看到第 5 行的循环中花费了 21 秒。我不明白其他 43 秒在做什么。
【问题讨论】: