Just like James said earlier in this thread, I highly recommend using something a little more advanced than just incrementing a counter variable every code cycle. The PIC18F8520 comes with 5 seperate timers (the first of which is used by IFI, so we have access to 4). They're pretty well documented in the
datasheet for the microcontroller (sections 11 through 15). Three 8bit timers, and one 16bit timer. With all of the capabilities of the processor, itself, I would be very disappointed to see any team counting cycles as a timing system. I'm already forcing my programming mentees to learn about timers, interrupts, and other such features of these nice little machines.