iceyee_sleep/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// **************************************************
// *  Author: Iceyee                                *
// *  Mail: iceyee.studio@qq.com                    *
// *  Git: https://github.com/iceyee                *
// **************************************************
//
// Use.

//! 延时.

use std::time::Duration;
use tokio::time::Sleep;

// Enum.

// Trait.

// Struct.

// Function.

/// 延时.
pub async fn sleep(t: usize) -> Sleep {
    return tokio::time::sleep(Duration::from_millis(t as u64));
}