Edward,

Take a look at this thread. You can easily measure the actual loop time, and adjust it accordingly.

http://www.picbasic.co.uk/forum/showthread.php?t=365

HTH,
 Darrel