Affect_unix.PtimeSourcePOSIX time.
This time is measured by sampling this clock.
Warning. POSIX time does not increase monotonically, it is subject to operating system calendar time adjustements and can even go back in time. Use Mtime if you want to wait for wall-clock time spans.
Note. This is a minimal version of the ptime library which has more tools to deal with POSIX timestamp (e.g. date-time values) with the same representation, head there for more.
Warning. This relies on an Unix.unblocker being setup on the executing domain.
wait_until t waits until the POSIX clock can be caught being greater or equal to the timestamp t. The actual supported resolution is unspecified and may also depend on scheduling but POSIX millisecond precision should be supported. Use observe_wait_until to measure the overshoot.
observe_wait_until is like wait_until but returns the value of the POSIX clock when the function returns.
wait_until' t tag is the action for wait_until. The action invocation enables and synchronizes with tag when the POSIX clock can be caught to be greater or equal to the timestamp t.
now () is the current value of the POSIX clock.
max_stamp is 9999-12-31 23:59:59.999999999999 UTC, the latest timestamp representable.
equal t0 t1 is true if and only if t0 and t1 are the same timestamps.
compare t0 t1 is a total order on timestamps that is compatible with timeline order.
is_earlier t ~than is true if and only if compare t than = -1.
WARNING. A POSIX time span is not equal to an SI second based time span. Do not use these functions to perform calendar arithmetic or measure wall-clock durations, you will fail.
diff t t' is the signed POSIX span t - t' that happens between the timestamps t and t'.
of_float_s d is like of_span but with d as a floating point second POSIX span d. This function is compatible with the result of Unix.gettimeofday. Decimal fractional seconds beyond 1e-12 are truncated.
to_float_s t is like to_span but returns a floating point second POSIX span.
Warning. Due to floating point inaccuracies do not expect the function to round trip with of_float_s; especially near Ptime.min_stamp and Ptime.max_stamp.
pp formats an unspecified, approximative, representation of timestamp, it looks like RFC 3339 but it's not do not use for serializing.
clock_gettime with CLOCK_REALTIME.gettimeofday is used.GetSystemTime and GetTimeZoneInformation are used.