Is there any simple way (minimum code) to get encoder direction and speed / rpm , not position ?

Encoder is incremental type , output are A,B,Z

I am thinking about using DT INT , but not sure where to start .

Could any one point me which direction to go ? Thank you