# Retrieving frame rate

**URL:** <https://forum.makecode.com/t/retrieving-frame-rate/41234>\
**Category:** Help\
**Created:** [December 25, 2025, 8:24pm UTC](https://forum.makecode.com/t/retrieving-frame-rate/41234 "2025-12-25T20:24:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frandev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/frandev/32/27644_2.png) [@frandev](https://forum.makecode.com/u/frandev)\
**Post date:** [December 25, 2025, 8:24pm UTC](https://forum.makecode.com/t/retrieving-frame-rate/41234/1 "2025-12-25T20:24:59Z")

</div>

How would one retrieve the frame rate in code? I’m making a function which shows stats about the game—graphics, performance, etc.—but I know not how to retrieve the frame rate. How would I do this?

---

<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:** [December 26, 2025, 1:55am UTC](https://forum.makecode.com/t/retrieving-frame-rate/41234/2 "2025-12-26T01:55:09Z")

</div>

There’s a built in way to do so, but I’m not sure how you can replicate that in makecode.

If your curious, go to the pause menu and enable “show stats”.

---

<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:** [December 26, 2025, 1:55am UTC](https://forum.makecode.com/t/retrieving-frame-rate/41234/3 "2025-12-26T01:55:17Z")

</div>

Ok, this really depends on if you’re using blocks or JavaScript. You’ll need someone to make an extension for you in blocks, or you’ll need a few grey blocks. I found the code that sets the fps in the fps counter thingy:

 ![Screenshot 2025-12-25 at 6.09.10 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/6/4/641832003944fb9c58760ff085b67d00d9e60cf0.png)  
It’s in Explorer → base → eventcontext.ts lines 76 - 107. It puts the fps into this variable, `control.EventContext.lastStats`, which is a string. You could get this value by doing something like `parseInt(control.EventContext.lastStats.substr(4))` which just strips off the “fps:” part and then converts it to a number. If you’re making a display, you can probably just keep it as a string if you wanted to.
