measure the speed of the motor using Encoder

i would like to measure the speed of my motor using the encoder on my motor can any one give me an example on how to do that

More details of the motor and encoder please