Skip to main content

default_clock

Function default_clock 

Source
pub fn default_clock() -> &'static SteadyClock
Expand description

A process-wide SteadyClock. The returned reference is valid for the lifetime of the program.

use drmkit_time::{Clock, default_clock};

let t0 = default_clock().now();
let t1 = default_clock().now();
assert!(t1 >= t0, "CLOCK_MONOTONIC must not run backwards");