Affect_unix.PtimePOSIX 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.
val wait_until : t -> unitwait_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.
val wait_until' : t -> 'tag -> 'tag Affect.Action.twait_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.
module Span : sig ... endPOSIX time spans.
val now : unit -> tnow () is the current value of the POSIX clock.
val epoch : tepoch is 1970-01-01 00:00:00 UTC.
val min_stamp : tmin_stamp is 0000-01-01 00:00:00 UTC, the earliest timestamp representable.
val max_stamp : tmax_stamp is 9999-12-31 23:59:59.999999999999 UTC, the latest timestamp representable.
compare t0 t1 is a total order on timestamps that is compatible with timeline order.
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'.
val of_float_s : float -> t optionof_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.
val to_float_s : t -> floatto_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.
val pp : Stdlib.Format.formatter -> t -> unitpp 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.