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