Collection of general purpose time tools.
#[ cfg( feature = "chrono" ) ]
{
use time_tools::*;
/* get milliseconds from UNIX epoch */
let now = time::now();
println!( "now {}", now );
/* get nanoseconds from UNIX epoch */
let now = time::now();
let now_ns = time::ns::now();
assert_eq!( now, now_ns / 1000000 );
/* get seconds from UNIX epoch */
let now = time::now();
let now_s = time::s::now();
assert_eq!( now / 1000, now_s );
}
cargo add time_tools
git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/time_tools_trivial
cargo run