WIRING of KY-040 Rotary Encoder plus Demo Code

Hi
Is there any code for this encoder such that it could measure rotational speed? I want to attached one to a pedal shaft of an excercise bike. This is a custom idea I am working using Virtual Reality.
Basically using an Arduino plugin to Unity I can tap into data from the Arduino. All I need are 2 simple values current rotational speed and direction of rotation.

Is this possible with this encoder?

Many thanks for anyones input.

Cheers
A