# setTimeout

## Description

Calls a function or evaluates an expression after a specified number of seconds.

## Input / Parameter

| Name       | Description                                                                        | Input Type | Default | Options     | Required |
| ---------- | ---------------------------------------------------------------------------------- | ---------- | ------- | ----------- | -------- |
| timeout    | The time before a function is executed, in milliseconds.                           | Number     | 0       | -           | No       |
| persistent | To identify whether this should still be executed outside the current active page. | Boolean    | false   | true, false | No       |
| extra      | The value to be included to the 'callback' as a system value under 'extra'.        | Any        | -       | -           | No       |

## Output

N/A

## Callback

### yesCallback

The function to be executed after the timeout.

## Video

Coming Soon.

## Example

The user wants to display the infoDialog after 3 seconds.

### Step

1. Call the function `setTimeout` to a button component with event `click` and enter the duration of the timeout.\
   timeout: 3000<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-976e273171ea81ec916482d53cdf3279af527989%2FsetTimeout-step-1.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-355f05f178123f9b464f5b70562f86f7c1de6862%2FsetTimeout-step-2.png?alt=media)
2. Call the function `infoDialog` in the callback of the `setTimeout` function to display a infoDialog after 3 seconds.\
   title: Message\
   content: Done\
   disableTimer: true<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-b1e2ef3e8853ba1e1748fc6b5f0b6d1070c9bdf3%2FsetTimeout-step-3.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-be9bea3a72f99c13ea04a87bfab4da665c0e8b3a%2FsetTimeout-step-4.png?alt=media)

### Result

When the button is pressed, the infoDialog will appear after 3 seconds.

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-1f5ae416aab14957f93c2260ac8951b9fe314998%2FsetTimeout-result-1.png?alt=media)

## Links


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/flow/settimeout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
