> This page is for SWML.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# sleep

> Set the amount of time for the current application to sleep for in milliseconds before continuing to the next action.

Set the amount of time for the current application to sleep for in milliseconds before
continuing to the next action.

**`sleep`** `object | integer` — required

An object that accepts the following properties, or an integer value directly.

---

## **Properties**

**`sleep.duration`** `integer` — required

The amount of time to sleep in milliseconds. Must be a positive number. Can also be set to a `-1` integer for the sleep to never end.

---

**Possible Values:** `-1` or any positive number

## **Examples**

### Timed Sleep Example

#### YAML

```yaml
version: 1.0.0
sections:
  main:
    - sleep: 5000
```

#### JSON

```json
{
  "version": "1.0.0",
  "sections": {
    "main": [
      {
        "sleep": 5000
      }
    ]
  }
}
```

### Forever Sleep Example

#### YAML

```yaml
version: 1.0.0
sections:
  main:
    - sleep: -1
```

#### JSON

```json
{
  "version": "1.0.0",
  "sections": {
    "main": [
      {
        "sleep": -1
      }
    ]
  }
}
```