For a measurement device I needed exact (instruction cycle accurate) timed intervals. In this program code, in every period, the main code executes first, which may take any number of instructions (that will fit in the period time window, please see code). Then the program will wait for the tmr0 value to reach 255. The program then knows when the tmr0 rollover is about to happen and synchronizes on that rollover to reach instruction cycle precision. There is also a version that will work everywhere in the program memory:

High precision timed events without interrupts for 12-bit PIC (instruction cycle accurate) using a non-isochronous main loop (without use of the pcl register)