Theoretical max RPM tachometer

With your code the maximum is probably around 60000rpm. If you change from millis() to micros() you could reach much higher frequencies.