Crates.io | time_tools |
lib.rs | time_tools |
version | 0.2.0 |
source | src |
created_at | 2022-01-10 14:47:46.181663 |
updated_at | 2024-03-16 17:06:26.23988 |
description | Collection of general purpose time tools. |
homepage | https://github.com/Wandalen/wTools/tree/master/module/core/time_tools |
repository | https://github.com/Wandalen/wTools/tree/master/module/core/time_tools |
max_upload_size | |
id | 511441 |
size | 27,834 |
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