I am trying to measure the time it takes for a shaft to stop spinning from a certain RPM to zero RPM. My plan was to use a 1024 PPR encoder and feed the pulses into a counter/timer board. I was thinking of counting pulses in a while loop, sending the pulse count to a shift register, and then comparing the shift register value with the current pulse count. If the two values are the same I would get the value of a timer set up in the loop to calculate time to zero speed. I am looking for some assistance, if anyone has done this before or knows of a better way, please let me know.