Syntax:
delay count
Description:
This statement causes program execution to pause for count
milliseconds (a millisecond is a thousandth of a second). Delay timing is accurate to the nearest "tick," which is about 16.7 milliseconds.
Example:
To pause a program for approximately 5 seconds, use the following code:
delay 5000
The following built-in constants are useful for producing delays of various durations:
_sec = 1000 '(1 second)
_secHalf = 500 '(1/2 second)
_seqQuarter = 250 '(1/4 second)
_secTenth = 100 '(1/10 second)
_sec60th = 17 '(about 1 tick)
_secTick = 17 '(about 1 tick)
Note:
The delay
statement ties up the CPU, so that no other processes can execute while the delay
is occurring (this limitation does not apply if you're using the "FB Lite" runtime). If you intend to implement a very long delay, then consider instead using a timing loop that includes calls to HandleEvents
.
See Also:
timer; time$; date$; HandleEvents