Sure, if you want to check other sensors, do other coding, then using the capture mode and interrupts would be the way to go. Roughly speaking:
Initialize the CCP1 by:
Setting the CCP1 as an input
Set CCP1CON for rising/falling edge
Clear the PIR1 flag
Set PIE = 1
Set GIE = 1
On Interrupt;
Clear the CCPiIF flag
Check the edge for rising/falling
If rising set capture back to falling edge, start TMR1
If falling stop TMR1, Read variables for CCPR1L, and CCPR1H, set capture to rising edge