March Docs

Conduit.Time

Functions

fnsleep_mssleep_ms(ms : Int) : ()#

Sleep for at least ms milliseconds.

Parks the calling green thread on the scheduler's timer (the runtime's
`sleep_ms` builtin): it holds no scheduler thread and uses no CPU while
waiting, so idle poll/heartbeat loops cost nothing between iterations.

(This used to yield `ms / 10` times instead. On an idle system each yield
returns immediately, so every "sleep" finished in microseconds and conduit's
worker, heartbeat, leader, stale-node and cron loops polled Postgres
continuously — several cores of CPU for an idle worker.)