# 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
