measure rpm of stepper motor

You don't need an encoder, since your program tells the motor when and how often to step.

RPM = 60*(number of steps/second)/(number of steps/revolution)