sleep
(sleep seconds)
Blocks for seconds — any non-negative real, so sub-second waits are written as 0.5 — and returns nil. A zero or negative duration returns immediately. Durations are rounded to whole milliseconds, the resolution every backend shares with get-internal-real-time.
The interpreter and the JVM park the thread. WASM Preview 1 (and so a --native executable) blocks in the host's poll_oneoff on a clock subscription, costing no CPU; a host that returns from it early is polled again for the rest of the interval. --component waits on the real host timer (wasi:clocks), forcing it through the module scheduler: the wait costs no CPU and other pending tasks still progress. A --no-wasi module signals instead of waiting: it imports no timer, and its clock only moves when its host writes it, so no interval can elapse while the call is running (see the clock and randomness guide).
(let ((start (get-internal-real-time)))
(sleep 0.5)
(print (>= (- (get-internal-real-time) start) 500)))