Theoretical max RPM tachometer

Do you have any suggestions as to how I could improve my code? Although I doubt I'll need to measure anything above 40k, always like improvements.