Synchronizing with internal clock
SYNC cycl#
SYNC
You may synchronize your program with an internal clock.
Calling SYNC with an given cycle time cycl starts the internal clock.
Each call to SYNC waits, until the next cycle of the internal clock is finished.
Example:
SYNC 1.0
FOR I=0 TO 50
IF I % 2= 0 THEN
? "tick ";
ELSE
? "tack"
ENDIF
SYNC
NEXT |
The program will write a "tick" or a "tack" every second, independ of the time, the printing needs.
TIMER and SYNC use the same internal timer. Calling the initial SYNC resets the timer. You must not use STARTTIMER or STOPTIMER if you use sync, because it will stop or reset the internal clock.
|