Count PORTB.0,100,ByteVar
This will count the pulse on PORTB.0 during 100mSec

You should measure the frequency at the sensor output first.