tarde 0.2.0

TARDE - Time And Rust Duration Ergonomics, a quick way to initalize std::time::Duration values
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::time::Instant;
use std::thread;
use tarde::{During, Error};

fn main() -> Result<(), Error> {
    let x = 42.millis()?;
    let now = Instant::now();
    thread::sleep(x); 

    println!("now.elapsed: {:#?}", now.elapsed());

    Ok(assert!(now.elapsed() >= x))
}