Expand description
Platform compatibility layer for WASM and native targets.
Provides unified APIs for spawn and sleep that work on both:
- Native (tokio runtime) - enabled by
nativefeature - WASM (browser event loop via wasm-bindgen-futures) - enabled by
wasmfeature
Note: When both features are enabled, native takes precedence.
Functionsยง
- now_ms
- Get current timestamp in milliseconds.
- sleep
- Async sleep.
- sleep_
noop - No-op sleep for backtesting (instant return). Use this in backtest mode to skip real delays.
- spawn
- Spawn an async task.
- yield_
now - Yield to the event loop without a timer delay.