Sleep


Pauses code execution for the given delay. The next line of code will not run until the delay has ended. Syntax:

Sleep(flex_delay);

Note that you may not have more than four simultaneous sleeps in a cog. Some example code with Sleep():

activated:
     if(on) Return;
     on=1;
     PlaySoundLocal(wav, 1, 0, 0);
     Sleep(GetSoundLen(wav));
     on=0;

Return;