Already discussed in the past
Did you try the search function of this forum? Certainly not because I'm sure you would have find something.
As usual: be more specific!
What is the range of RPM you want to measure, how many slots in the disk, what accuracy do you want, what measuring frequency do you want (1 measurement per hour, or 100 measurements per second?)
Two major possibilities:
1) Measure the time your input is high.
2) Count the number of pulses from a high frequency signal (eg. 4MHz) while your input is high.
Which method to use depends on your requirements.