easytime
Providing wrapper types for safely performing panic-free checked arithmetic on instants and durations.
This crate provides the following two data structures.
-
easytime::Instant
-- A wrapper type forstd::time::Instant
-
easytime::Duration
-- A wrapper type forstd::time::Duration
Usage
Add this to your Cargo.toml
:
[]
= "0.2"
Compiler support: requires rustc 1.34+
Examples
use ;
use Duration as StdDuration;
If you use std::time
directly, you need to write as follows:
use ;
Optional features
std
(enabled by default)- Enable to use
easytime::Instant
. - If disabled this feature,
easytime
can be used inno_std
environments.
- Enable to use
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.