Description
Suspend execution of script for given uiTime. uiSleep is a sleep method to delay script execution where script time/simulation time is stopped. uiSleep is basically using the system time (uiTime more specifically) and not simulation time. So in the cases where sleep would get stuck indefinitely, uiSleep 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
uiSleep delay
Parameters:
delay: Number
Returns: Nothing
Examples
Example 1
In singleplayer:
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 · sleep · waitUntil · canSuspend · spawn · execVM · Control Structures · sleep vs uiSleep