An easy and convenient way to check "time-critical routine" is to toggle a spare pin within the routine and check the square wave period with the oscilloscope.

Al.