11 System Clock

Event Scheduling

Eloquence provides a mechanism to do efficient and straightforward scheduling of future events without using programmed delays.

The ON DELAY Statement

The ON DELAY command schedules a software interrupt after a specified number of tenths of a second have elapsed.

The specified interval must be an integer number of milliseconds greater than 100 and less than or equal to 231-1. This value provides a time in milliseconds that is in the range 100 to 231-1. The resolution of software interrupts is one millisecond. This means that although the elapsed time from the execution of the ON DELAY command to the first software interrupt may be less than one second, the operating system will provide (assuming the Eloquence program does not fall behind) subsequent software interrupts at the precise interval specified.

For example, if you wanted to schedule a software interrupt every 5.8 seconds, you would use:

10  ON DELAY 5800 GOTO ...
Note that the ON DELAY statement is active every 5.8 seconds (not for just one 5.8 second interval). You must use the OFF DELAY statement to de-activate the ON DELAY statement.

An interrupt triggered by an ON DELAY statement sets the value of CURKEY to 55.

The OFF DELAY Statement

The OFF DELAY command cancels the scheduled future software interrupts.

OFF DELAY


Eloquence Language Manual - 19 DEC 2002