|
Contents | Previous | Next | Subchapters |
| Syntax |
sleep |
sleep(option) | |
| See Also | pause , clock , time |
sleep are ignored.
If option is the string "on" (or "ON"),
subsequent calls to sleep are not ignored.
If option is not present,
execution is suspended until the user selects a continue button
in a special dialog that is displayed.
for i = 1 to 5 begin
print i
sleep(1)
end
Will print the numbers 1 though 5 at a rate of one number per second.
You can use the sleep function when creating
animated graphics.
The following example animates a sine wave though one cycle.
theta = 0. : .1 : 2 * pi
for i = 0 to 50 begin
alpha = 2 * pi * i / 50.
ginitview
gplot(theta, sin(alpha + theta))
gxaxis("offlin", 0., 2 * pi);
gyaxis("offlin", -1., 1.)
gupdate
sleep(.2)
end
pause
instead of sleep.
If in Mlmode you enter
for i = 1:5
i
pause(1)
end
O-Matrix will
print the numbers 1 though 5 at a rate of one number per second.
sleep function
to the "on" state.