Skip to content
lsl.devlsl.devLSL Dev

llSleep

function
Function syntax
llSleep(
  1. float sec// Duration in seconds to put the script to sleep.
);
Energy
0

Puts the script to sleep for sec seconds. The script will not do anything during this time.

The script will sleep at least until the next server-frame, which happen every (1/45 = ~0.02222) seconds under normal conditions.

If sec is zero or less, the script will not sleep at all.

How to use
llSleep(0.0);
Example 1
default
{
state_entry()
{
llSay(0, "I going to take a nap for 5 seconds.");
llSleep(5.0);
llSay(0, "I feel so refreshed!");
}
}
Example 2
8 collapsed lines
default
{
state_entry()
{
llOwnerSay("Time between sleeps:");
integer loops = 10;
float last_time = 0.0;
llResetTime();
llSleep(0.02);
while (--loops)
{
float time = llGetTime();
llOwnerSay((string)(time - last_time));
last_time = time;
llSleep(0.0); // Try a value above zero
}
}
}
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from LlSleep, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

  • LlSleep (revision 1217326, )

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.