suspend-time 0.1.2

A cross-platform monotonic clock that is suspend-unaware, written in Rust!
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::time::Duration;

#[tokio::main]
async fn main() {
    // If you suspend the system during main's execution, Tokio will time
    // out even though it only slept for 1 second. `suspend_time::timeout` does not.
    let _ = suspend_time::timeout(
        Duration::from_secs(2),
        suspend_time::sleep(Duration::from_secs(1)),
    )
    .await;
}