You can also do this without interrupts by just monitoring a timer overflow flag bit.

Here's one example;
http://www.picbasic.co.uk/forum/showthread.php?t=6957