Affect_unix.MtimeMonotonic time.
This time is measured by sampling this clock. It increases monotonically and, in contrast to Ptime, is not subject to operating system calendar time adjustments.
module Span : sig ... endTime spans.
Warning. This relies on an Unix.unblocker being setup on the executing domain.
val wait_for : Span.t -> unitwait_for span blocks the caller until a minimum amount of span time has elapsed on the monotonic clock. The actual supported resolution is unspecified and may depend on scheduling but millisecond waits should be reasonably precise. Use observe_wait_for to measure the overshoot.
observe_wait_for is like wait_for but returns the actual amount of monotonic time that elapsed on the monotonic clock between the call and when it returned.
val wait_for' : Span.t -> 'tag -> 'tag Affect.Action.twait_for' span tag is the action for wait_for. The action invocation enables and synchronizes with tag after a minimum amount of span monotonic time has elapsed on the monotonic clock.
val counter : unit -> countercounter () is a counter counting from now on.
count c is the amount of time that has elapsed on the monotonic clock since c was created.
val elapsed : unit -> Span.telapsed () is the amount of time that has elapsed on the monotonic clock since the beginning of the program.
Note. Only use timestamps if you need inter-process time correlation, otherwise prefer elapsed and counters to measure time.
The type for monotonic timestamps relative to an indeterminate system-wide event (e.g. last startup). Their absolute value has no meaning but can be used for inter-process time correlation.
val now : unit -> tnow () is the current system-relative timestamp on the monotonic clock. Its absolute value is meaningless.
val min_stamp : tmin_stamp is the earliest timestamp.
val max_stamp : tmax_stamp is the latest timestamp.
is_earlier t ~than is true if and only if t occurred strictly before than.
is_later t ~than is true if and only if t occurred strictly after than.
span t0 t1 is the span between t0 and t1 regardless of the order between t0 and t1.
add_span t s is the timestamp s units later than t or None if the result overflows.
sub_span t s is the timestamp s units earlier than t or None if overflows.
val to_uint64_ns : t -> int64to_uint64_ns t is t as an unsigned 64-bit integer nanosecond timestamp. The absolute value is meaningless.
val of_uint64_ns : int64 -> tto_uint64_ns t is t is an unsigned 64-bit integer nanosecond timestamp as a timestamp.
Warning. Timestamps returned by this function should only be used with other timestamp values that are know to come from the same operating system run.
val pp : Stdlib.Format.formatter -> t -> unitpp is a formatter for timestamps.
clock_gettime with CLOCK_BOOTTIME. This means that sleep time is taken into account.clock_gettime with CLOCK_MONOTONIC.mach_continous_time, sleep time is taken into account. For MacOS < 10.12, mach_absolute_time is used, sleep time is not taken into account.