# Better Idea for a delay function?

**URL:** https://community.thunkable.com/t/better-idea-for-a-delay-function/546918
**Category:** Questions about Thunkable X
**Created:** [March 31, 2020, 9:05am UTC](https://community.thunkable.com/t/better-idea-for-a-delay-function/546918 "2020-03-31T09:05:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rollke](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rollke/32/14413_2.png) [@rollke](https://community.thunkable.com/u/rollke)
#### Post date: [March 31, 2020, 9:05am UTC](https://community.thunkable.com/t/better-idea-for-a-delay-function/546918/1 "2020-03-31T09:05:28Z")

</div>

Hi, for my memory game app I need a function to wait for a small amount of time after someone has opened two pictures by button click. So the user can see his choice for a second or less.

My solution is to get the seconds since 1970, add the seconds to wait and count down to the actual seconds since 1970. That works. But only for whole seconds. With tests to use a timer, I failed.  
Is there an idea to create a wait function by use of the timer?

 ![Bildschirmfoto 2020-03-30 um 16.19.50](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/1/f18f22f96409b3e2aa2045d06a247af1b55a542d.png)

 ![Bildschirmfoto 2020-03-31 um 10.42.13](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/e/7efe04ce75bda423058287dc104f7f0ef3e2e957.png)

 ![Bildschirmfoto 2020-03-31 um 10.42.26](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/1/416d0f203f6aba07aff0a9d53ece2c7e7d389770.png)

Link to my project:

([Thunkable](https://x.thunkable.com/copy/ae53264673a5f763f421fb5aaa09fb17))

---

<div class="post-metadata">

### Author: ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)
#### Post date: [March 31, 2020, 10:13am UTC](https://community.thunkable.com/t/better-idea-for-a-delay-function/546918/2 "2020-03-31T10:13:37Z")

</div>

Why not use the `wait` block @rollke?

 ![Screenshot 2020-03-31 at 10.57.44](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/e/8ead0833fb12da3f445ef3bbce77177f481bfafa.png)

Obviously, with 20 buttons you’d want to create a function here instead, but these blocks work fine for me.

Here’s a demo:

> **[thunkablecompanion](https://thunk.app/w/KBKpW3y5Y)**
>
> Powered by Thunkable

* * *

UPDATE:

Here’s a quick tutorial showing how to make a full parameterised version of this:

> [@Creating a Toggle in Thunkable](http://community.thunkable.com/t/creating-a-toggle-in-thunkable-x/53574/5):
>
> Creating a Resetting Switch Something like a “normally closed” switch, in this example we’ll make a button that defaults to “off” or that can reset itself after a predetermined amount of time. The blocks below will work for any number of switches: Demo Preview for yourself here: [https://thunk.app/w/KBKpW3y5Y](https://thunk.app/w/KBKpW3y5Y)

---

<div class="post-metadata">

### Author: ![rollke](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rollke/32/14413_2.png) [@rollke](https://community.thunkable.com/u/rollke)
#### Post date: [March 31, 2020, 10:34am UTC](https://community.thunkable.com/t/better-idea-for-a-delay-function/546918/3 "2020-03-31T10:34:20Z")

</div>

Sorry,  
I really forgot this control “wait”. Could it be, that it was not there in former times. Sometimes things change or improve and you do not recognize 😉

That is the proper solution. Wait even works with decimal.

Than You.

[https://x.thunkable.com/copy/a8bcdce3940e96e0990fbe3c051366ca](https://x.thunkable.com/copy/a8bcdce3940e96e0990fbe3c051366ca)

---

<div class="post-metadata">

### Author: ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)
#### Post date: [March 31, 2020, 10:40am UTC](https://community.thunkable.com/t/better-idea-for-a-delay-function/546918/4 "2020-03-31T10:40:44Z")

</div>

Eh…@rollke???

 ![Screenshot 2020-03-31 at 11.24.44](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/6/865fa72abcc2710e0674ba5ee70e506696a85a63.png)

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 11:39am UTC](https://community.thunkable.com/t/better-idea-for-a-delay-function/546918/5 "2024-11-08T11:39:33Z")

</div>


