Time.Clock

lib/Time/Clock.gob

The two clocks the system keeps. The library reads them here and nowhere else, and each reading comes out as a type that says which clock it was: an Instant for the first, a Reading for the second, which Stopwatch and Deadline are made of.

type Reading : Ord

A reading of the monotonic clock: nanoseconds from an arbitrary start, so it means something only next to another reading.

fun realtime : fun() -> Instant

The system clock, which may be set back or forward while the program runs. CLOCK_REALTIME is 0 on both targets.

fun coarseRealtime : fun() -> Instant

realtime as of the system's last clock tick: up to a tick behind it, a few milliseconds, and cheaper to read. On Darwin, which keeps no such clock, it is realtime.

fun monotonic : fun() -> Reading

The clock that only moves forward, at a steady rate.

fun later : fun(Reading, Duration) -> Reading

The reading d after r.

fun between : fun(Reading, Reading) -> Duration

The time from from to to: negative if to is earlier.

fun nanos : fun(Reading) -> Int

The nanoseconds of r, for the scheduler's waits, which take the same clock's nanoseconds.