https://www.pjrc.com/teensy/td_libs_Encoder.html

https://www.arduino.cc/reference/en/libraries/encoder/

There is!