For any particular bit of code, is there a way to easily get a breakdown of how long it took each line to execute?
Python code is not executed as is, the program you typed in is compiled into an intermediate format that is optimized. So the same line can very well take different times depending on the surrounding lines. Also, Python has complex operations on its data, the time an operation takes will depend on the exact values handled.
In Python, what is the best way to determine how long each line of code takes to execute?