1#![deny(missing_docs)]
3extern crate lazycell;
4extern crate mio;
5extern crate slab;
6
7#[macro_use]
8extern crate log;
9
10pub mod channel;
11pub mod timer;
12
13mod convert {
15 use std::time::Duration;
16
17 const NANOS_PER_MILLI: u32 = 1_000_000;
18 const MILLIS_PER_SEC: u64 = 1_000;
19
20 pub fn millis(duration: Duration) -> u64 {
26 let millis = (duration.subsec_nanos() + NANOS_PER_MILLI - 1) / NANOS_PER_MILLI;
28 duration
29 .as_secs()
30 .saturating_mul(MILLIS_PER_SEC)
31 .saturating_add(u64::from(millis))
32 }
33}