async-rs / async-rs/async-std

simple sleep consumes a lot of cpu

Open
#604 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

```rust
use async_std::task;
use std::time::Duration;

fn main() {
task::block_on(async {
loop {
task::sleep(Duration::from_micros(100)).await;
}
});
}
```

This code consume a lot of cpu.

![image](https://user-images.githubusercontent.com/510012/70050585-4f0da600-160a-11ea-810c-c227741885b7.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.