Steve, you may have to look at Interrupts to prevent main code "delays". Look into using Timer0 or Timer1 as an interrupt that is PIC clock based, and set it up to count to 1000mS. Most PIC clocks run too fast to make it 1 second with one timer interrupt setup. Set up a interrupt routine, perhaps triggering every 100mS, that counts 10 times to reach 1000mS. Then, look into a pin to interrupt on change (IOC pin), and in that interrupt routine, increment a counter, whether it be a byte, word, or long word. That increment is what you are counting of course. When timer0 interrupts for the 10th time, stop all interrupts, read the value you incremented in the other interrupt routine, and set a simply bit/byte flag for the main routine to check if "time is up". Your main routine can then process the value, then clear the timers and interrupt stored value and re-enable interrupts.
This way, your main routine runs forever with no pauses.
I use the following utility to calculate PIC timer values, including which registers to set. It is not exactly the same register names as Oshonsoft, but very close, you can easily set the equivalent registers. This calculator has an option to show settings in C, Basic or Pascal. It is from another compiler vendor, but seems open to the public:
https://libstock.mikroe.com/projects/view/398/timer-calculator
Next time, it would help if you mentioned what PIC you are using...