Encoder, how do I???

I have a few Opto-endstops, "optical interrupter's" and would like to use them along with my mill to make a nice Encoder for a Lathe Spindle.

I am not sure you can do this.

Do you need to detect the motion in two directions or just one.
One is easy you just count the number of pulses, maybe even with an interrupt.
To what purpose do you want to put the count information you get?