help in making engine digital RPM meter

first I want to ask that should I convert the frequency to 0 - 5 volt ( taking Vout = 5 volt at 7000 Rpm) and read it with the analog input pin..??

so my 0 - 7000 RPM will be analog read rpm = map(rpm, 0, 1023, 0, 7000)

OR

There is other better way to do it for better precession and accuracy..??