macro_rules! sleep {
($e:literal min) => { ... };
($i:ident min) => { ... };
($e:literal sec) => { ... };
($i:ident sec) => { ... };
($e:literal nano) => { ... };
($i:ident nano) => { ... };
($e:literal micro) => { ... };
($i:ident micro) => { ... };
($e:literal milli) => { ... };
($i:ident milli) => { ... };
}
Expand description
Makes a thread sleep a amount following a time pattern.
Paterns:
- min: minutes
- sec: seconds
- nano: nanoseconds
- micro: microseconds
- milli: milliseconds
Examples
use sugars::sleep;
// Thread sleeps for 10 seconds
sleep!(10 sec);