# "Wait until" function

**URL:** <https://discourse.processing.org/t/wait-until-function/30792>\
**Category:** Beginners\
**Created:** [June 19, 2021, 10:46am UTC](https://discourse.processing.org/t/wait-until-function/30792 "2021-06-19T10:46:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [June 19, 2021, 10:46am UTC](https://discourse.processing.org/t/wait-until-function/30792/1 "2021-06-19T10:46:25Z")

</div>

Hi! I developing a game when I realised a “wait until” function would be interesting. Is there any way to do it other than (I want to use delay() with it, since it will be used in thread("")😉

```auto
while(condition == false) {
    delay(1000);
}

```

it just checks 1 every second to see if the condition is false, otherwise it exits the loop. Any other suggestions?

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [June 19, 2021, 2:14pm UTC](https://discourse.processing.org/t/wait-until-function/30792/2 "2021-06-19T14:14:39Z")

</div>

Hi,

There are plenty of exemple in this forum. Have a look at this [thread](https://discourse.processing.org/t/how-can-i-put-a-three-second-delay-within-an-if-loop/11965) for exemple.

And if I remember correctly @GoToLoop did some utility functions to help with that.
