DCode
Covers Engine 2.0.0
when
Run on every visit after the condition qualifies for a finite positive time in seconds.
Run on every visit after the condition qualifies for a finite positive time in seconds. False resets timing; changing time preserves the true interval. Monotonic gaps, holds and skipped branches count. Nonblocking; no checks are scheduled. Use if for immediate conditions and nest once for one-time runtime-section work.
Syntax
when(condition, time=seconds):Available in
- Executable DCode bodies
Native C++
Uses fixed retained timer state; repeated qualification does not sleep, schedule work or allocate.
Example
when(condition, time=0.5):
-- body