esleep 1.1.0

std::thread::sleep(std::time::Duration::from_secs(10)) -> esleep::s(10)
Documentation
  • Coverage
  • 0%
    0 out of 5 items documented0 out of 4 items with examples
  • Size
  • Source code size: 4.18 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.04 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MDZZDYXCMDZZDYXC

esleep

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);

Simple encapsulation

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));
}