# How can I get the FPS

**URL:** https://forum.makecode.com/t/how-can-i-get-the-fps/5596
**Category:** Help
**Created:** [January 17, 2021, 2:54am UTC](https://forum.makecode.com/t/how-can-i-get-the-fps/5596 "2021-01-17T02:54:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [January 17, 2021, 2:54am UTC](https://forum.makecode.com/t/how-can-i-get-the-fps/5596/1 "2021-01-17T02:54:59Z")

</div>

I added shadows to my game and they make it look very nice! Except that when I spawn hundreds of sprites (that get their own shadows) you can imagine that the FPS plummets. So I have a variable that dictates whether I should spawn a shadow with the sprite. How can I get the FPS (like what the simulator says, or what is displayed at the bottom on hardware) so when it dips, say below 30 I turn shadows off?

---

<div class="post-metadata">

### Author: ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)
#### Post date: [January 17, 2021, 3:22am UTC](https://forum.makecode.com/t/how-can-i-get-the-fps/5596/2 "2021-01-17T03:22:12Z")

</div>

Like a battery-save mode?

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [January 17, 2021, 3:22am UTC](https://forum.makecode.com/t/how-can-i-get-the-fps/5596/3 "2021-01-17T03:22:21Z")

</div>

Or to put it in 6 words: How can I get the FPS?

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [January 17, 2021, 3:46am UTC](https://forum.makecode.com/t/how-can-i-get-the-fps/5596/4 "2021-01-17T03:46:09Z")

</div>

Yea! Except of keeping the 🔋, I’m trying to keep my computer (and PyGamer) from going 🔥.

---

<div class="post-metadata">

### Author: ![fd268](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/fd268/32/35044_2.png) [@fd268](https://forum.makecode.com/u/fd268)
#### Post date: [January 17, 2021, 4:03pm UTC](https://forum.makecode.com/t/how-can-i-get-the-fps/5596/5 "2021-01-17T16:03:23Z")

</div>

there is a forever loop that slows when the fps drops so you can do this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/9180b5654d4b6d42b502942b693d5b4446264de4.png)

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [January 17, 2021, 8:28pm UTC](https://forum.makecode.com/t/how-can-i-get-the-fps/5596/6 "2021-01-17T20:28:12Z")

</div>

Ah nice! Very ingenious! Maybe instead of a forever, I’ll use a on game update because that runs every frame!

I’m just wondering if there was a TS command to do something like `control.instantFPS()`.
