lastTick = timer_GetCount();
for(;;) {
    thisTick = timer_GetCount();
    if (lastTick > thisTick) {
        // normally count down
        moduloTick = lastTick - thisTick;
    } else {
        // handle rollover:
        moduloTick = lastTick + 0xFFFFFFFF - thisTick;
    }
    // should we process?
    if (moduloTick > INTERVAL) {
        lastTick = thisTick;   // save new count as old
        doWhatNeedsToBeDone(); // process stuff
    }
} // forever 