# Why use "forever" over "on game update"?

**URL:** <https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318>\
**Category:** Help\
**Created:** [June 2, 2026, 6:12pm UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318 "2026-06-02T18:12:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![DimonSw0rd11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dimonsw0rd11/32/32564_2.png) [@DimonSw0rd11](https://forum.makecode.com/u/DimonSw0rd11)\
**Post date:** [June 2, 2026, 6:12pm UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/1 "2026-06-02T18:12:32Z")

</div>

This is a little different than the rest of the help posts, but is there any reason to use a forever block over on game update?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 2, 2026, 6:20pm UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/2 "2026-06-02T18:20:52Z")

</div>

on game update is for when you have code that you want to be guaranteed to run every frame at the same time (for example, doing physics stuff, animations, etc). every single on game update is guaranteed to run and finish before the frame is drawn to the screen. as a result, you can’t use any blocks that pause inside of an on game update because it will freeze your whole game.

forever is much looser; it isn’t tied to the frame so you can pause all you want without freezing your game. the downside is that forever isn’t guaranteed to run every frame like on game update is.

let’s take a look at an example:

> **[forever-vs-update](https://arcade.makecode.com/S66192-48299-80805-68015)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

here’s the code:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/4/c4fb49df918828ef7e1efe033ec96fc73a3f2413.png)

if you hold down the A button or the B button in this game, you’ll hear sounds playing. however, the A button will freeze the game since it’s in an on game update. the B button won’t freeze the game because it’s inside a forever

---

<div class="post-metadata">

**Author:** ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)\
**Post date:** [June 2, 2026, 10:58pm UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/3 "2026-06-02T22:58:32Z")

</div>

Oh I see; “On Game Update” runs within a single frame, “Forever” runs in the background.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 2, 2026, 10:59pm UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/4 "2026-06-02T22:59:54Z")

</div>

yup! that’s a concise way of putting it

---

<div class="post-metadata">

**Author:** ![ScriptScraper](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/scriptscraper/32/35438_2.png) [@ScriptScraper](https://forum.makecode.com/u/ScriptScraper)\
**Post date:** [June 3, 2026, 3:04am UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/5 "2026-06-03T03:04:29Z")

</div>

how many updates/frames per second is there? I’ve heard a bunch of people say it’s 30, but when I test it, it’s 50

---

<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:** [June 3, 2026, 3:06am UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/6 "2026-06-03T03:06:07Z")

</div>

IIRC, the game update code will run up to 30 times per second. If you display statistics, it shows the theoretical FPS. It’s not literal.

---

<div class="post-metadata">

**Author:** ![ScriptScraper](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/scriptscraper/32/35438_2.png) [@ScriptScraper](https://forum.makecode.com/u/ScriptScraper)\
**Post date:** [June 3, 2026, 5:10pm UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/7 "2026-06-03T17:10:35Z")

</div>

Like I said, when I test it, stuff updates around 50 times a second. This sprite should only say 30, but it says 48-50

> **[Testing](https://arcade.makecode.com/S31777-40701-67664-15171)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 3, 2026, 5:11pm UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/8 "2026-06-03T17:11:13Z")

</div>

@ScriptScraper you are correct! it’s 48. i have no idea why we decided on that number

---

<div class="post-metadata">

**Author:** ![TheEarth](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/theearth/32/34579_2.png) [@TheEarth](https://forum.makecode.com/u/TheEarth)\
**Post date:** [June 3, 2026, 11:53pm UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/9 "2026-06-03T23:53:19Z")

</div>

I thought u said you changed it to 60 with the march 2025 update bro

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 4, 2026, 4:37pm UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/10 "2026-06-04T16:37:00Z")

</div>

nope?

---

<div class="post-metadata">

**Author:** ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)\
**Post date:** [June 5, 2026, 2:23am UTC](https://forum.makecode.com/t/why-use-forever-over-on-game-update/44318/11 "2026-06-05T02:23:35Z")

</div>

> **[delta time](https://arcade.makecode.com/S14527-98199-57753-13047)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

It uses delta time and I recommend using delta time

it calculates the fps (technically every 200 ms, but can every frame)
