Faster Routine

Sorry I can't understand your code....

If you want to output a square wave, use a PWM (up to 84 MHz), or output PMC_PCK (up to 480 MHz)

What do you measure as a clock signal in your code ?