Constant roundable::SECOND

source ·
pub const SECOND: Duration;
Expand description

A second. Useful for rounding Duration.

use roundable::{SECOND, Roundable, Tie};
use std::time::Duration;

assert!(SECOND == Duration::from_millis(500).round_to(SECOND, Tie::Up));