It is difficult to understand what you want.
Is it a rotary encoder you have?
http://www.arduino.cc/playground/Main/RotaryEncoders
or do you want to measure the period of pulses:-
http://www.arduino.cc/en/Reference/PulseIn
Or do you want the pulses to trigger an interrupt and you count them in an interrupt service routine?
http://gonium.net/md/2006/12/20/handling-external-interrupts-with-arduino/