Precise timing with a PIC18 microcontroller?
What you see here is the delay between the moment the timer has reached 100 (meaning your if-condition is true) and when you reset it. In your case this is 2 timer ticks, meaning you get a longer period. As already said, if you want to have precise timing use interrupts. Alternatively, you can configure your timer to overflow exactly in the right moment. That way, you just need to check for an overflow to occur, and don't need to reset it.