You have the idea correct: this is an implementation of what Ian suggested. Whether the pulses are periodic or not does not matter. In this implementation TMR1 only counts on a rising or falling edge (depends on how you configure it) of the external input (in this case the pulse you're monitoring). You are using TMR0 with the internal (or PIC) clock to gate your measurement. When TMR0 expires, you check TMR1 and you have how many pulses were received in your specified time. You need to set the TMR1 prescaler so as to not overflow it - I doubt you would even with a 1:1 prescaler ratio though (if the closest the pulses can be is 10kHz, and you have a 100ms gate time, the most pulses you could have are 1000 - well within the 16-bit resolution of the TMR1).