wait
until
while
condition
wait
for
number unit
Condition is an expression that always yields true
or false
. Number yields an integer
or a number
. Unit is one of the following: nanoseconds
, microseconds
, milliseconds
, seconds
, ticks
, minutes
, hours
, nanosecond
, microsecond
, millisecond
, second
, tick
, minute
, or hour
.
The wait
command causes the interpreter to pause before executing the rest of the script. The wait until
form will pause until the specified condition becomes true
. The wait while
form will pause until the specified condition becomes false
. The wait for
form will pause for the specified length of time.
If no unit is specified, the wait
command assumes ticks
, defined as sixtieths of a second.
The wait
command causes a busy wait—the interpreter keeps running in an infinite loop, checking the specified condition or the elapsed time since the command began executing. Although you can specify a length of time as short as a nanosecond, there is absolutely no guarantee on how long the wait will actually be. The wait
command cannot be used for thread synchronization or real-time applications.
HyperTalk only supports seconds
, ticks
, second
, and tick
for the unit.