Delay
Delay Pause execution for a specified interval #include <OSUtils.h> Operating System Utilities
void Delay(duration, finalTick ); unsigned long duration ; number of ticks (1/60-th seconds) to delay unsigned long *finalTicks ; receives system time at end of the delay Delay enables interrupts and keeps control until a specified interval in ticks (1/60-th second units) has elapsed.
duration specifies the desired duration of the delay, in 1/60-th second
(16.6 ms) units. For instance, if duration = 60, the delay will
last approx. 1 second.
finalTicks is the address of a 32-bit long. Upon return, it will contain the
value of Ticks (the number of ticks since system startup) as it was when Delay returned control.
Notes: Because of the possibility of interrupts being disabled or overridden for
short periods, Delay may last one or more ticks longer than you requested in duration. Thus, you should not rely on pinpoint accuracy here.
The finalTicks parameter can be used as an accuracy gauge to see if you did lose a tick or two.
The global variable Ticks is updated upon every vertical retrace. See Ticks are generally referred to as 1/60th of a second. It is actually
1/60.15 seconds. However, if you need this kind of accuracy, you should not