# Stop A Timer (10 second timer)

**URL:** https://discourse.processing.org/t/stop-a-timer-10-second-timer/30764
**Category:** Processing
**Tags:** homework
**Created:** [June 17, 2021, 6:23pm UTC](https://discourse.processing.org/t/stop-a-timer-10-second-timer/30764 "2021-06-17T18:23:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![UrguitaLoka](https://avatars.discourse-cdn.com/v4/letter/u/6a8cbe/32.png) [@UrguitaLoka](https://discourse.processing.org/u/UrguitaLoka)
#### Post date: [June 17, 2021, 6:23pm UTC](https://discourse.processing.org/t/stop-a-timer-10-second-timer/30764/1 "2021-06-17T18:23:17Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [June 17, 2021, 6:36pm UTC](https://discourse.processing.org/t/stop-a-timer-10-second-timer/30764/2 "2021-06-17T18:36:37Z")

</div>

`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…?
