windowless_sleep

Crates.iowindowless_sleep
lib.rswindowless_sleep
version0.1.1
sourcesrc
created_at2023-10-16 19:59:12.826841
updated_at2023-10-16 19:59:12.826841
descriptionA sleep function for wasm that doesn't rely on window
homepage
repositoryhttps://github.com/futurepaul/windowless_sleep/
max_upload_size
id1005082
size2,293
Paul Miller (futurepaul)

documentation

README

windowless sleep

The web-sys crate uses the window object to access the global setTimeout function, which doesn't work in contexts like web workers, WASI, node.js, or, most importantly, bun.

This is a version of sleep that just uses whatever global setTimeout function happens to exist. No idea if this will help with WASI but it works in web workers and bun.

Commit count: 2

cargo fmt