async-rs / async-std

Async version of the Rust standard library

Home Page:https://async.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[wasm] Sleep awakes to early

VincentJousse opened this issue · comments

The documentation says :

The thread may sleep longer than the duration specified due to scheduling specifics or platform-dependent functionality. It will never sleep less.

But the duration is truncated towards zero.

The std::thread::sleep documentation says :

Platforms which do not support nanosecond precision for sleeping will have dur rounded up to the nearest granularity of time they can sleep for.

Duration should be rounded up to the nearest millisecond.