mk90.basic.statements

Statement WAIT

Sleep cooperatively for an RTC-tick interval.

Syntax

WAIT ticks

Parameters

ParameterMeaning
ticksExpression whose signed result is 0–32767.

Behavior

At the nominal 32 Hz rate, WAIT 32 requests one second. WAIT 0 yields without a timed wait. Other runnable native contexts may continue.

The deadline is modular and resumption depends on the scheduler. SU+C is checked after returning to a runtime polling point, not continuously inside this timed sleep.

Example

10 FOR I=1 TO 3
20 PRINT I
30 WAIT 32
40 NEXT I
50 END

Limits and diagnostics

This is a timer extension, not a port-mask WAIT statement found in some BASICs. The shell WAIT command waits for a PID and is different.

Status-code reference.

See also

FOR · BEEP · Language syntax