cProfile は、そのモジュールで費やされた時間を示しているだけです。行番号は、そのモジュールで処理された最初のステートメントを示しているようです-複数行のdocstringがあるため、docstringの最後の行を示しています。
"""
Test module for cProfile stats
"""
import time
def wait(t):
time.sleep(t)
wait(5)
与えます:
$ python -m cProfile test.py
4 function calls in 5.002 seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 5.001 5.001 test.py:10(wait)
1 0.001 0.001 5.002 5.002 test.py:4(<module>)
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
1 5.001 5.001 5.001 5.001 {time.sleep}
wait
最初の行は関数で費やされた時間を示し、2 番目の行はモジュールで費やされた時間を示していることに注意してください。