Avisaro Online Documentation - Wiki
Impressum Kontakt Sitemap

SLEEP

Description

SLEEP puts the program asleep for the specified interval. To set this interval, SLEEP needs a single argument that is, the milliseconds to sleep. After time-out elapses, the program awakes and continues execution. As a special case, if you supply zero as argument, SLEEP gives away its time quantum so that another task is immediately scheduled.

Example

Prints some numbers with a delay of one second:

outmode -2
for s = 1 to 10
   print s
   sleep 1000
next
print "ready"

Remarks

SLEEP 0 initiates an immediate context switch to another task. Which task runs next belongs to the scheduling algoritm of the RTOS. The Scripting Language can't specify that.