timeout

Macro timeout 

Source
timeout!() { /* proc-macro */ }
Expand description

Parse a human-readable timeout specification.

Creates a std::time::Duration from a human-readable format.

§Supported Units

  • ns, nanos, nanoseconds - Nanoseconds
  • us, micros, microseconds - Microseconds
  • ms, millis, milliseconds - Milliseconds
  • s, sec, secs, seconds - Seconds
  • m, min, mins, minutes - Minutes
  • h, hr, hrs, hours - Hours

§Examples

use rust_expect_macros::timeout;

let short = timeout!(100 ms);
let medium = timeout!(5 s);
let long = timeout!(2 m);
let compound = timeout!(1 m + 30 s + 500 ms);