In my opinion, you should use a high-speed counter (HSC) card. Standard I/O is seldom fast enough to handle pulse counting or RPM-calculation applications.
How fast is this shaft rotating ? Have you used an oscilloscope to measure how long the proximity input is high while the bolt head is passing by ?
The easiest way to measure RPM is to count for a specific period of time, then divide the counts by the time interval.
Have you attempted to write this routine yet, or are you asking for help from the very start ?