Stop A Timer (10 second timer)

I am trying to build a Clicks Per Second Test (CPS), but I can’t make the timer stop at the 10-second mark. This would allow gamemode-2 to be activated and calculate the actual clicks per second. My attempt of doing that is in line 39. (Please if you know how to solve my problem help me).

if(millis() - startTime > 10000) {....

  • and before setup() int startTime;

  • and when starting the timer (e.g. at end of setup()) startTime = millis();

Maybe you forgot to post your code…?