Functions | |
void | Enable_Wakeup_Events (double interval) |
void | Disable_Wakeup_Events (double interval) |
void Enable_Wakeup_Events | ( | double | interval | ) |
Starts a wakeup running within the computer.
interval | - The interval, in seconds, at which the wakeup should go off. |
When the wakeup expires, a wakeup event will be queued. The wakeup will be automatically rearmed and keep repeating indefinitely, expiring at regular intervals, until such time as it is disabled by your program. A repetitively-expiring wakeup such as this can be used, for example, to space out the frames of an animation that your system is more than keeping up with.
To implement a "one-shot" wakeup, disable the wakeup as soon as the first wakeup event has been received. You might use this kind of wakeup to provide a time-out for user input or for an error display.
The system keeps a count of how many times a particular interval has been enabled. The system only turns off the wakeup when the corresponding number of disables has been received. This allows lower levels of your program not to worry about whether the upper levels happen to be using the same wakeup.
For any given wakeup, at most two expiration events can be pending at a time in the event queue. If another expiration comes along while two are already pending, the wakeup is rearmed but no additional event is queued. This limit helps keep your program from getting way behind the clock.
The magnitude of interval can be as large as you please.
void Disable_Wakeup_Events | ( | double | interval | ) |
Turns off wakeups.
interval | - The interval, in seconds, at which the wakeup should go off. |