I've searched for something like this and not had much success but I'm sure its been done somewhere. I'm looking for some code the would show the loop time for the whole program. This does not seem like it should be difficult but I've not figured it out.
Make a note of the millis timer at the start of the loop and at the end, the difference is the loop time to the nearest millisecond.
For very short loops, set pin 13 high at the start of the loop and low at the end and measure the time of the pulse using an oscilloscope.