Quote Originally Posted by andrewwaack View Post
is there a way of making this code more accurate
Learn how to use the TIMER interrupts...
Put the PIC to sleep using the sleep instruction, let the TIMER interrupt wake up the PIC, increment a counter to keep track of elapsed seconds/milliseconds/minutes/hours/whatevever, take whatever action is neccessary based on elasped time, put the PIC back to sleep.