Definition: delay(ms [, guard]) { ... } — Allowed: inside blocks; guard is numeric expression; Not allowed: top-level declaration.
Non-blocking inline scheduler usable inside any block. It queues its nested block to run once after the evaluated delay and then immediately returns to the caller. Optionally provide a guard expression as the second argument; it is re-evaluated when the delay fires, and the block runs only if the guard is still true. Use next; to early-exit the delayed block run.
// Pulse output 1 for 500 ms without blocking
out(1) = 1;
delay(500) { out(1) = 0; }
Guarded form: delay(2000, in(1)) { out(1) = 0; } skips the block if in(1) went low before fire time.
You can nest delays to build sequences: delay(200) { out(2) = 1; delay(200, in(1)) { out(2) = 0; } }.