Or Timer1 and Interrupt on Change or even better Interrupt on PortB.0 and use of Option_reg.6 to select which edge is expected to arrive and trigger the interrupt.

Needs a bit of work in the interrupt routine...

Ioannis