# Trouble with 'while' loops

**URL:** <https://forum.makecode.com/t/trouble-with-while-loops/17560>\
**Category:** Help\
**Created:** [January 23, 2023, 6:01pm UTC](https://forum.makecode.com/t/trouble-with-while-loops/17560 "2023-01-23T18:01:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirbop](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kirbop/32/6659_2.png) [@kirbop](https://forum.makecode.com/u/kirbop)\
**Post date:** [January 23, 2023, 6:01pm UTC](https://forum.makecode.com/t/trouble-with-while-loops/17560/1 "2023-01-23T18:01:51Z")

</div>

Whenever I try to use a ‘while’ loop in my projects, the simulator just displays a blank screen no matter what other code I have. Even if the loop doesn’t contain any code, this still happens. Does anyone have some insights?

---

<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 23, 2023, 7:29pm UTC](https://forum.makecode.com/t/trouble-with-while-loops/17560/2 "2023-01-23T19:29:02Z")

</div>

Call `pause(0);` (any integer time works, even 0, but it obviously won’t have a delay of 0) so Arcade has a chance to redraw the screen, etc.

Also don’t forget to break out of the while loop eventually, either by using a condition in the while loop, or use the `break;` statement.

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [January 24, 2023, 7:22pm UTC](https://forum.makecode.com/t/trouble-with-while-loops/17560/3 "2023-01-24T19:22:15Z")

</div>

I was about to say that too, while loops go on forever if you don’t implement a way to stop.
