Time.Deadline

lib/Time/Deadline.gob

A point ahead on the monotonic clock, for a limit on how long something may take: made once, from a Duration, and then asked how much time is left, so that a limit on a whole operation can be handed to each step of it. Like a Stopwatch, it reads the clock that only moves forward, so setting the system clock neither cuts it short nor stretches it, and it does not turn into an Instant.

< orders deadlines by when they fall, so the tighter of two is the lesser.

type Deadline : Ord
fun after : fun(Duration) -> Deadline

The deadline d from now.

fun remaining : fun(Deadline) -> Duration

The time left before dl, and zero once it has passed: never negative, so that handing it on as a timeout cannot ask for a negative wait, which some system calls read as waiting forever.

fun passed : fun(Deadline) -> Bool

Whether dl has passed.

fun reading : fun(Deadline) -> Reading

The monotonic reading dl falls at.