What is the difference between tottime and cumtime in a python script profiled with cProfile?
问题 I am profiling a python script main.py using cProfile with the following command: python -m cProfile -s tottime main.py The output I get is (only copy-pasted the top lines of the output): 10184337 function calls (10181667 primitive calls) in 13.597 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 1 4.674 4.674 13.598 13.598 main.py:2(<module>) 2142 2.964 0.001 4.663 0.002 load_aerdat3.py:61(getPacket) 459 2.381 0.005 2.381 0.005 {waitKey}