Debouncing Code For RPM Reading

Maybe some of the discussion in this recent and similar thread are useful to you: Arduino reading frequency correctly in the real world

That is 25kHz or a period of 40uS !