Skip to content

Commit

Permalink
time: add wait alias to sleep (#3897)
Browse files Browse the repository at this point in the history
  • Loading branch information
Milo123459 committed Jun 28, 2021
1 parent 959c5c9 commit ab0791b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tokio/src/time/driver/sleep.rs
Expand Up @@ -57,6 +57,7 @@ pub fn sleep_until(deadline: Instant) -> Sleep {
/// [`interval`]: crate::time::interval()
// Alias for old name in 0.x
#[cfg_attr(docsrs, doc(alias = "delay_for"))]
#[cfg_attr(docsrs, doc(alias = "wait"))]
pub fn sleep(duration: Duration) -> Sleep {
match Instant::now().checked_add(duration) {
Some(deadline) => sleep_until(deadline),
Expand Down

1 comment on commit ab0791b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'sync_mpsc'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: ab0791b Previous: 959c5c9 Ratio
send_large 57534 ns/iter (± 9255) 27271 ns/iter (± 2428) 2.11

This comment was automatically generated by workflow using github-action-benchmark.

CC: @tokio-rs/maintainers

Please sign in to comment.