If you want to measure up to 9999 rpm, then the minimum period will be 60 msec. This is a very long time for a PIC (let's say a 16F84A at 12MHz). You can use the RB0 interrupt (edge triggered).
You program your timer T0 to have an interrupt every 1 msec.
For every T0 interrupt, you increment a 16 bit variable (name it CNT).
Each time you get an RB0 interrupt, just copy CNT to a temp location, calculate the RPM and reset CNT so you are ready for the next turn of the motor turn.