# Basic timer question

**URL:** <https://community.thunkable.com/t/basic-timer-question/1300622>\
**Category:** Questions about Thunkable X\
**Tags:** timer\
**Created:** [May 22, 2021, 5:01pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622 "2021-05-22T17:01:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 22, 2021, 5:01pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622/1 "2021-05-22T17:01:52Z")

</div>

Since [the current WDC](https://community.thunkable.com/t/wdc-16-can-you-re-create-fahads-pomodoro-timer-app/1299502) is all about timers, I thought I’d ask a really basic question. The timer component has always confounded me. For example, why doesn’t this change the value of the label?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/3/43a85d4d56c44a86dae4fda255e5ec86860e81f7.png)

My timer is set to count up with an interval of 1. When I preview it, it just shows “1” and doesn’t change.

I realize I could change the value of a variable each time the timer fires but I’m specifically trying to understand what the “Timer1’s Time in seconds” block is for. Shouldn’t it hold the elapsed or remaining time?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 22, 2021, 5:07pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622/2 "2021-05-22T17:07:39Z")

</div>

There must be something fundamental I don’t understand about timers because this doesn’t do anything, either:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/9/7907a0149725aab29c4d361ae8f3936afdceef5b.png)

It would be great if [the documentation](https://docs.thunkable.com/timer) had a working example.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 22, 2021, 5:15pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622/3 "2021-05-22T17:15:21Z")

</div>

The short answer is enable the **three** switches in the timer. I find it working this way.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/6/d6745dadc47cd93fe5725c34a5f5c609b797cac1.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 22, 2021, 5:25pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622/4 "2021-05-22T17:25:56Z")

</div>

I tried that but it still isn’t working for me.

**Edit** weird. Now it’s working.

Sometimes the lag in previewing changes really throws me off.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 22, 2021, 5:28pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622/5 "2021-05-22T17:28:24Z")

</div>

> [@tatiang](#):
>
> Sometimes the lag in previewing changes really throws me off.

Agree 😁

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 22, 2021, 5:29pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622/6 "2021-05-22T17:29:41Z")

</div>

So it seems like setting those values in blocks doesn’t work but setting them in the Timer gear menu does. And the timer won’t run at all without Loops set to true.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 22, 2021, 5:31pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622/7 "2021-05-22T17:31:50Z")

</div>

I saw the `loop` switch is the controlling one. It `false` then it triggers once, if `true` it keeps on triggering but just to avoid any other unexplainable situation. I set all to `true`.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 22, 2021, 5:33pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622/8 "2021-05-22T17:33:50Z")

</div>

The documentation needs a lot more detail. For example:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/9/b9019453907b1531688b860f3da74051911a57c3.png)

Does “Loops” set to true mean that the timer triggers every interval that it’s set to (e.g. once per second)? That’s what I’m assuming but my first instinct is that it mean the timer would reset to 0 after reaching some value (e.g. 60 seconds total) or reset to its starting value once reaching zero if counting down.

The component might better be called something like “metronome”\* because the green “Timer1’s Time in seconds” block just vacillates between 0 and 1 when the interval is set to 1 second.

\*Although this is probably just my ignorance as a programmer…

---

<div class="post-metadata">

**Author:** ![human](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/human/32/101416_2.png) [@human](https://community.thunkable.com/u/human)\
**Post date:** [May 22, 2021, 6:14pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622/9 "2021-05-22T18:14:52Z")

</div>

@tatiang,

To see how I coded the timer, remix my project and go to the Mitochondria Masher screen.

> [@film\_projector WDC #15 "Show Thunkable"](https://community.thunkable.com/t/wdc-15-show-thunkable/1283467/31):
>
> Since I’m still working on my sprite app (I’ll probably be presenting it in WDC #16), I’ll show you all another app I built for a school project, which actually happens to be the first app I ever coded in Thunkable. Without further ado, I present… LEARN-SCI An app where kids can have fun learning science and playing games! Splash Screen: Navigation Screen: Mass Extinction Screen:

Hope that helps.

---

<div class="post-metadata">

**Author:** ![human](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/human/32/101416_2.png) [@human](https://community.thunkable.com/u/human)\
**Post date:** [May 22, 2021, 6:55pm UTC](https://community.thunkable.com/t/basic-timer-question/1300622/10 "2021-05-22T18:55:00Z")

</div>

> [@tatiang](#):
>
> That’s what I’m assuming but my first instinct is that it mean the timer would reset to 0 after reaching some value (e.g. 60 seconds total) or reset to its starting value once reaching zero if counting down.

I think so, but I’m not sure.

You can also check the Thunkable Documentation for more info.

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [May 25, 2021, 11:16am UTC](https://community.thunkable.com/t/basic-timer-question/1300622/11 "2021-05-25T11:16:44Z")

</div>

Hi there,

If Loops is true, the timer will fire repeatedly.  
If Loops is false, then the timer will not continue to fire after it next fires (so I can create a timer, loops = false, it will fire once and no more).  
I can clarify this in the docs, but we probably won’t change this property’s name.

I’ll check in with the team about the original topic of the `time in [seconds|milliseconds]` blocks not returning the expected value.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 25, 2021, 11:38am UTC](https://community.thunkable.com/t/basic-timer-question/1300622/12 "2021-05-25T11:38:18Z")

</div>

Yes, this is how I understood it.

> [@muneer](#):
>
> I saw the `loop` switch is the controlling one. It `false` then it triggers once, if `true` it keeps on triggering

That was my explanation.

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [May 26, 2021, 6:56am UTC](https://community.thunkable.com/t/basic-timer-question/1300622/13 "2021-05-26T06:56:01Z")

</div>

I appreciate you explaining it as well!

@tatiang I have updated the [Timer docs](https://docs.thunkable.com/timer#loops) with a more detailed description of the Loops function. Please check it out and let me know what you think!

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 26, 2021, 7:05am UTC](https://community.thunkable.com/t/basic-timer-question/1300622/14 "2021-05-26T07:05:31Z")

</div>

That’s really cool @jane . Could you also update the Count Up function a little bit? It’s probably just me, but I don’t really understand what Count Up is and how it works.

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [May 26, 2021, 7:07am UTC](https://community.thunkable.com/t/basic-timer-question/1300622/15 "2021-05-26T07:07:20Z")

</div>

The `Time in [seconds|milliseconds]` blocks don’t work exactly the way you have programmed them here.

This block will return the remaining time on your Timer’s interval.

So if your Timer’s interval is 5 seconds, this block will count down 4, 3, 2 1, 0.

If your timer’s interval is 1s, and you show this value when the timer fires, it will always show 0, as there are 0 seconds remaining on the Timer.

Here is an example of how your Timer could be set up, and how you would work with it in the blocks:

 ![Screen Shot 2021-05-26 at 8.07.00 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/0/a05d4e93a38c0150e7218bddb9cc03b73bad75a8.png)

 ![Screen Shot 2021-05-26 at 8.06.13 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/3/238491c5f589d1e54de9cff7e1b2932c60e38475.png)

You can see a project that demonstrates how to use these blocks [here](https://x.thunkable.com/projectPage/60adf15cf59875001247e31a/)

This is now explained in the [Timer docs](https://docs.thunkable.com/timer#get-time). Thanks for asking about it!

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 26, 2021, 7:12am UTC](https://community.thunkable.com/t/basic-timer-question/1300622/16 "2021-05-26T07:12:42Z")

</div>

Looks good! Thank you for updating that.

@jane I think the link you posted right above might be a private project. I can’t open it.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 26, 2021, 7:26am UTC](https://community.thunkable.com/t/basic-timer-question/1300622/17 "2021-05-26T07:26:02Z")

</div>

Unable to open the project @jane .

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 26, 2021, 8:16am UTC](https://community.thunkable.com/t/basic-timer-question/1300622/18 "2021-05-26T08:16:51Z")

</div>

this is the setup i use that works for me:

1. from the design tab, set up the timer component to have an interval of 1sec, set it to count down, set loop to true and set enable to false.
2. before you start the timer, set a variable timer\_val to the desired time duration (in seconds); also set enable to true
3. start (call timer1’s start)
4. when timer fires (ie. it just counted down 1 sec, as defined in the component setup), then it’s time to reduce the timer\_val by 1. when timer\_val has gone down to zero it’s time to stop the timer (ie. call timer1’s stop) and set enable to false.
5. if you set a new variable display\_val = timer\_val and show it for display, the time will show as counting down.
6. HOW TO COUNT UP? use the same set up as above but always compute this when timer fires.  
set the display\_val = ORIGINAL\_DURATION ENTERED MINUS TIMER\_VAL

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [May 27, 2021, 7:40am UTC](https://community.thunkable.com/t/basic-timer-question/1300622/19 "2021-05-27T07:40:37Z")

</div>

@tatiang @codeswept I apologize! You should be able to access the project now.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 27, 2021, 7:41am UTC](https://community.thunkable.com/t/basic-timer-question/1300622/20 "2021-05-27T07:41:56Z")

</div>

Great, thanks @jane !

[Next page](https://community.thunkable.com/t/basic-timer-question/1300622.md?page=2)
