Skip to main content

yield_now

Function yield_now 

Source
pub async fn yield_now()
Expand description

Yield to the event loop without a timer delay.

  • Native: Uses tokio::task::yield_now (cooperative scheduling)
  • WASM: Uses Promise.resolve() microtask (much faster than setTimeout)

This is crucial for backtesting - allows browser to stay responsive without the ~4ms+ overhead of setTimeout timers.