use std::time::Duration;
use waitforit::Wait;
const CHECK_DURATION: Duration = Duration::from_secs(1);
fn main() {
let ten_sec = Wait::new_elapsed_from_duration(Duration::from_secs(10));
let lockfile = !Wait::new_file_exists("something.lock");
let w = ten_sec & lockfile;
let start = std::time::Instant::now();
w.wait(CHECK_DURATION);
println!("Step 1 complete after {:?}", start.elapsed());
let ten_sec = Wait::new_elapsed_from_duration(Duration::from_secs(10));
let lockfile = !Wait::new_file_exists("something.lock");
let w = ten_sec & lockfile;
let not_w = !w;
let start = std::time::Instant::now();
not_w.wait(CHECK_DURATION);
println!("Step 2 complete after {:?}", start.elapsed());
}