There's so many way to do it... i'm not so familiar with your kind of application but, IMO you can use PULSEIN with rotary encoder or opto-coupler.
OR you can use internal TIMER to get a accurate timing.
Some will also prefer to read a voltage instead of pulses. Converting pulse into voltage can be made with a simple RC circuit connected to a Buffer op-amp.
Bookmarks