Crates.io | tarde |
lib.rs | tarde |
version | 0.2.0 |
source | src |
created_at | 2019-09-10 15:29:15.723381 |
updated_at | 2019-09-11 14:10:59.737172 |
description | TARDE - Time And Rust Duration Ergonomics, a quick way to initalize std::time::Duration values |
homepage | https://github.com/deg4uss3r/tarde |
repository | https://github.com/deg4uss3r/tarde |
max_upload_size | |
id | 163849 |
size | 21,486 |
TARDE (tar-dee, Time And Rust Duration Ergonomics) is a small library to allow for better ergonomics when using std::time::Duration
.
use std::time::Instant;
use tarde::{During, Error};
fn main() -> Result<(), tarde::Error> {
let now = time::Instant::now();
thread::sleep(10.millis()?);
Ok(assert!(now.elapsed() >= 10.millis()?))
}