elfo-core 0.2.0-alpha.21

The core of the elfo system
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::time::Duration;

use tokio::time::Instant;

pub use self::{delay::Delay, interval::Interval};

mod delay;
mod interval;

fn far_future() -> Instant {
    // Copied from `tokio`.
    // Roughly 30 years from now.
    // API does not provide a way to obtain max `Instant`
    // or convert specific date in the future to instant.
    // 1000 years overflows on macOS, 100 years overflows on FreeBSD.
    Instant::now() + Duration::from_secs(86400 * 365 * 30)
}