# Countdown timer

**URL:** <https://cl.desmos.com/t/countdown-timer/173>\
**Category:** Examples\
**Created:** [July 10, 2018, 3:34pm UTC](https://cl.desmos.com/t/countdown-timer/173 "2018-07-10T15:34:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [July 10, 2018, 3:34pm UTC](https://cl.desmos.com/t/countdown-timer/173/1 "2018-07-10T15:34:38Z")

</div>

Creates a Countdown timer from 30 seconds starting at button press

> **[CL Scavenger Hunt Example 24 • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5b32c6209e40cc0cb6202a38)**
>
> by The Bank of Wonders

---

<div class="post-metadata">

**Author:** ![scott\_lockhart](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/scott_lockhart/32/319_2.png) [@scott\_lockhart](https://cl.desmos.com/u/scott_lockhart)\
**Post date:** [June 11, 2019, 8:19pm UTC](https://cl.desmos.com/t/countdown-timer/173/2 "2019-06-11T20:19:21Z")

</div>

When I run this, my timer stops at 20 (starts at 30, counts down, and doesn’t go lower than 20). Is this an error? Is there something in the code I’m missing?

Also, is there a way to force a student to the next page if the timer gets to zero?

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [June 11, 2019, 9:39pm UTC](https://cl.desmos.com/t/countdown-timer/173/3 "2019-06-11T21:39:45Z")

</div>

Nice catch! Since this example was made, timeSincePress has been updated to increase until a set value with a default of 10 seconds.

adding a number in the ( ) will set the max timer. in this case `timeSincePress(30)`

For your second question, no we can’t force a student on to another screen. However, you can set things up on your screen to disable or hide once a certain time has been reached.

---

<div class="post-metadata">

**Author:** ![scott\_lockhart](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/scott_lockhart/32/319_2.png) [@scott\_lockhart](https://cl.desmos.com/u/scott_lockhart)\
**Post date:** [June 12, 2019, 6:28pm UTC](https://cl.desmos.com/t/countdown-timer/173/4 "2019-06-12T18:28:36Z")

</div>

Thank you for the fast and helpful response. I was a bit worried this was an old post and not monitored anymore. 🙂

---

<div class="post-metadata">

**Author:** ![wtodom](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/wtodom/32/2271_2.png) [@wtodom](https://cl.desmos.com/u/wtodom)\
**Post date:** [February 26, 2021, 5:13pm UTC](https://cl.desmos.com/t/countdown-timer/173/5 "2021-02-26T17:13:40Z")

</div>

I tried to use this code, and the timer still stopped at 20 seconds even with the timesincepress (30) in the code. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [February 27, 2021, 11:27am UTC](https://cl.desmos.com/t/countdown-timer/173/6 "2021-02-27T11:27:58Z")

</div>

It’s hard to tell what the problem might be without the exact snippet of code that was used, but it needs to look just like this, where button is the name of the button component.

```auto
button.timeSincePress(30)

```

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [February 27, 2021, 4:48pm UTC](https://cl.desmos.com/t/countdown-timer/173/7 "2021-02-27T16:48:14Z")

</div>

Even @JayChow 's stops at 20 seconds when I checked.

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [February 27, 2021, 6:11pm UTC](https://cl.desmos.com/t/countdown-timer/173/8 "2021-02-27T18:11:43Z")

</div>

I just looked at the code and it wasn’t updated to include the 30 second timer, which is why it’s stopping at the default. I changed it to stop at 30 seconds and it worked as intended.

> **[\[Copy of\] CL Scavenger Hunt Example 24 • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/603a8a373169770cab45bd31)**
>
> by Craig Winske

---

<div class="post-metadata">

**Author:** ![Poovandrie\_Jansen](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/poovandrie_jansen/32/5002_2.png) [@Poovandrie\_Jansen](https://cl.desmos.com/u/Poovandrie_Jansen)\
**Post date:** [May 20, 2025, 10:24pm UTC](https://cl.desmos.com/t/countdown-timer/173/9 "2025-05-20T22:24:00Z")

</div>

How could I do this? Hide a table when the time has elapsed.  
Thanks
