python -m cProfile -s cumulative main.py
It seems that you can see the execution speed of each function. It's amazing.
Story of measuring code execution time with IPython
In iPython, you can measure the execution time of your code with the% time command like this. Hey.
In [2]: %time l = range(10000)
CPU times: user 4 µs, sys: 1e+03 ns, total: 5 µs
Wall time: 7.87 µs
Therefore, IPython also provides a command called% timeit that automatically executes% time an appropriate number of times and returns the average value as a guideline for the execution time.
% prun and% run -p I didn't even know.
See here. Story of measuring code execution time with IPython
end.
Recommended Posts