Crates.io | esleep |
lib.rs | esleep |
version | 1.1.0 |
source | src |
created_at | 2023-06-16 02:21:48.059687 |
updated_at | 2023-06-16 07:26:24.177644 |
description | std::thread::sleep(std::time::Duration::from_secs(10)) -> esleep::s(10) |
homepage | |
repository | https://gitee.com/w-8/esleep |
max_upload_size | |
id | 891731 |
size | 4,511 |
I can't stand doing this every time;
If you want to sleep for 10 seconds;
std::thread::sleep(std::time::Duration::from_secs(10));
Now
You just write;
esleep::s(10);
and more
pub fn s(var:u64){
std::thread::sleep(std::time::Duration::from_secs(var));
}
pub fn ms(var:u64){
std::thread::sleep(std::time::Duration::from_millis(var));
}
pub fn us(var:u64){
std::thread::sleep(std::time::Duration::from_micros(var));
}
pub fn ns(var:u64){
std::thread::sleep(std::time::Duration::from_nanos(var));
}