Accuracy is not a problem. What could be a problem is what sort of environment it has to cope with. the easiest way is just to put a white segment on a black shaft or disc. Shine a LED on this disc and use a photoelectric cell/photodiode to get a higher light reflection from the white bit. Or drill a hole through the disc and shine the light through this. Amplify the output from the PE cell/photodiode and turn it into a square pulse wave form. Now you want to measure the frequency of this waveform. How you do this is dependent on how precise you want your readings to be, i.e. 4000RPM +-1% you can analogue methods and display the output on a moving coil meter, higher precision then this and you must use a digital counter whereby you could read the RPM to 1 part in 10,000,000.
Frank