Crate wasm_ticker

source ·
Expand description

Non-block tick executor for WebAssembly Rust.

Ticker callbacks queue as Tasks to JavaScript event loop. Instead of Microtasks or just stacking in, Tasks won’t block current host context and UI rendering thread. See also https://developer.mozilla.org/docs/Web/API/HTML_DOM_API/Microtask_guide/in_depth

TickerAPIPlatformInterval
Browser / Node
MessageChannelTickerChannel Messaging*>4µs / <1µs
ImmediateTickersetImmediateNode~1µs
TimeoutTickersetTimeout*~4ms / ~14ms
AnimationFrameTickerrequestAnimationFrameBrowserAccording to device
AutoTickerOne of above*N/A

Modules§

Enums§

Traits§