# Timer wont work right!

**URL:** <https://forum.makecode.com/t/timer-wont-work-right/40043>\
**Category:** Help\
**Tags:** graphics-and-math, make, extension\
**Created:** [October 28, 2025, 2:16am UTC](https://forum.makecode.com/t/timer-wont-work-right/40043 "2025-10-28T02:16:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rune](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/rune/32/18951_2.png) [@Rune](https://forum.makecode.com/u/Rune)\
**Post date:** [October 28, 2025, 2:16am UTC](https://forum.makecode.com/t/timer-wont-work-right/40043/1 "2025-10-28T02:16:31Z")

</div>

I was making a countdown in my game for the Heist Jam, but its a big game, and the lag messed with the timing. I thought it would be a simple fix with the Deltatime Extension but it still doesn’t work.

I copied the code into the project below, please help.

> **[TIMER HELP!!!](https://arcade.makecode.com/82584-96385-30209-59350)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

The demo includes the timer and a bunch of sprites to lag the game. You can press A to clear the sprites without resetting the timer.

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![Rune](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/rune/32/18951_2.png) [@Rune](https://forum.makecode.com/u/Rune)\
**Post date:** [October 31, 2025, 5:00pm UTC](https://forum.makecode.com/t/timer-wont-work-right/40043/2 "2025-10-31T17:00:16Z")

</div>

Bump. I would like to fix this before november.

---

<div class="post-metadata">

**Author:** ![Rune](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/rune/32/18951_2.png) [@Rune](https://forum.makecode.com/u/Rune)\
**Post date:** [November 3, 2025, 6:50pm UTC](https://forum.makecode.com/t/timer-wont-work-right/40043/3 "2025-11-03T18:50:45Z")

</div>

AAAA the jam is about to end and I cant fix it! HELP PLEASE!!!

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [November 3, 2025, 6:55pm UTC](https://forum.makecode.com/t/timer-wont-work-right/40043/4 "2025-11-03T18:55:55Z")

</div>

I completely forgot about this, Rune. Thanks for the reminder. I’ll bookmark this and look at it tonight when I get home from work.

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [November 3, 2025, 8:54pm UTC](https://forum.makecode.com/t/timer-wont-work-right/40043/5 "2025-11-03T20:54:45Z")

</div>

My immediate thought is that you should be multiplying by delta time, not dividing, though I haven’t tested anything yet.

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [November 3, 2025, 11:25pm UTC](https://forum.makecode.com/t/timer-wont-work-right/40043/6 "2025-11-03T23:25:57Z")

</div>

I was correct in my initial guess, but also that “delta” block is very incorrect. It _looks_ like it’s correct at first, but after the lag actually starts it becomes wildly incorrect. What you should be doing is this:

 ![Screenshot 2025-11-03 at 4.08.20 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/5/d5c1d6cbacdf2cbc6c04e3c02bfe9c1b2179ea81.png)  
The “delta” block is taking the maximum of the delta time \* 30 and 1. This is… incorrect. It means that until the lag gets bad enough that delta time \* 30 is greater than 1, you’re just multiplying/dividing by 1. That’s why the timer looked correct when you were dividing, until the lag started to affect it, and it became very wrong.

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [November 4, 2025, 5:09am UTC](https://forum.makecode.com/t/timer-wont-work-right/40043/7 "2025-11-04T05:09:31Z")

</div>

I’m going to assume Woof Woof has solved this for you, Rune. (Thanks, bro!) If you still need help, then be sure to holler.

---

<div class="post-metadata">

**Author:** ![Rune](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/rune/32/18951_2.png) [@Rune](https://forum.makecode.com/u/Rune)\
**Post date:** [November 4, 2025, 5:29pm UTC](https://forum.makecode.com/t/timer-wont-work-right/40043/8 "2025-11-04T17:29:13Z")

</div>

YEEEAAAA

Thank you thank you thank you

My game is in your debt. (if I can finish it in time)
