mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-15 00:00:15 +02:00
time: add wait alias to sleep (#3897)
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user