---
name: "uiSleep"
type: command
status: ok
groups: ["Program Flow"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/uiSleep
revid: 370497
updated: 2024-12-26T17:41:42Z
---

# uiSleep

*Command · Program Flow · Arma 3 v0.50 · introduced in Arma 2 v1.05*

## Description

Suspend execution of script for given [uiTime](../commands/uiTime.md). [uiSleep](../commands/uiSleep.md) is a sleep method to delay script execution where script time/simulation time is stopped.
[uiSleep](../commands/uiSleep.md) is basically using the system time (uiTime more specifically) and not simulation time.
So in the cases where [sleep](../commands/sleep.md) would get stuck indefinitely, [uiSleep](../commands/uiSleep.md) can still be used to effectively delay script execution for example in pause or in a mission briefing or an editor or when simulation is paused in general.

## Syntax

```sqf
uiSleep delay
```

**Parameters:**

- `delay`: [Number](../topics/Number.md)

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

In singleplayer:

```sqf
setAccTime 0.25;    // slows down time
sleep 1;            // waits for 1 second in-game, 4 IRL seconds (1 / 0.25)

setAccTime 0;        // freezes simulation
// sleep 1;            // would wait forever
uiSleep 1;            // waits for 1 IRL second
```

## See also

[uiTime](../commands/uiTime.md) · [sleep](../commands/sleep.md) · [waitUntil](../commands/waitUntil.md) · [canSuspend](../commands/canSuspend.md) · [spawn](../commands/spawn.md) · [execVM](../commands/execVM.md) · [Control Structures](../topics/Control_Structures.md) · sleep vs uiSleep

<sub>Source: [BI Community Wiki — uiSleep](https://community.bistudio.com/wiki/uiSleep) (revision 370497).</sub>
