How to check PIC system clock speed MCU?
Congrats on making the effort to make sure your clock is set up correctly.  Its super important on dspics, which will search for alternative clocks if it doesn't see the clock it expects. 

You're very close. Instead of trying to validate you clock by using a compiled loop where you think you know how many ticks you use, just toggle a bit in a timer interrupt, and spend the time you need to understand how to set up the timer correctly.  Even though yyou don't want to,  I think its much easier in the short run.  The alternative is going to be looking at your assembly code the compiler generates to make sure you understand what the compiler is doing to your loops, or just writing the loop in assembly.