logo
Expand description

Collection of time tools.

Module :: time_tools

experimental rust-status docs.rs discord

Collection of general purpose time tools.

Sample

#[ 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 );
}

To add to your project

cargo add time_tools

Try out from the repository

git clone https://github.com/Wandalen/wTools
cd wTools
cd sample/rust/time_tools_trivial
cargo run

Re-exports

pub use protected::*;

Modules

Dependencies.

Exposed namespace of the module.

Shared with parent namespace of the module

Prelude to use essentials: use my_module::prelude::*.

Protected namespace of the module.

Collection of general purpose time tools.