Skip to main content

sleep_delta_secs

Function sleep_delta_secs 

Source
fn sleep_delta_secs(next: i64, wall_now_secs: i64) -> Result<u64, Error>
Expand description

Whole seconds to sleep until the next scheduled time next, measured from the current wall clock wall_now_secs.

Fallible: next must be strictly after wall_now_secs and the difference must fit in u64. In practice i64::MAX - i64::MIN is exactly u64::MAX, so the difference always fits once next > wall_now_secs; the explicit error keeps the scheduled loop panic-free and wrap-free regardless.