Ptime.SpanPOSIX time spans.
WARNING. A POSIX time span is not equal to an SI second based time span.
The type for signed picosecond precision POSIX time spans. A value of this type represent the POSIX duration between two POSIX timestamps.
val v : (int * int64) -> tval of_d_ps : (int * int64) -> t optionof_d_ps (d, ps) is a span for the signed POSIX picosecond span d * 86_400e12 + ps. d is a signed number of POSIX days and ps a number of picoseconds in the range [0;86_399_999_999_999_999L]. None is returned if ps is not in the right range.
val to_d_ps : t -> int * int64to_d_ps d is the span d as a pair (d, ps) expressing the POSIX picosecond span d * 86_400e12 + ps with ps in the range [0;86_399_999_999_999_999L]
val of_int_s : int -> tof_int_s secs is a span from the signed integer POSIX second span secs.
val to_int_s : t -> int optionto_int_s d is the span d as a signed integer POSIX second span, if int's range can represent it (note that this depends on Sys.word_size). Subsecond precision numbers are truncated.
val of_float_s : float -> t optionof_float_s secs is a span from the signed floating point POSIX second span d. Subpicosecond precision numbers are truncated.
None is returned if secs cannot be represented as a span. This occurs on Stdlib.nan or if the duration in POSIX days cannot fit on an int (on 32-bit platforms this means the absolute magnitude of the duration is greater than ~2'941'758 years).
val to_float_s : t -> floatto_float_s s is the span s as floating point POSIX seconds.
Warning. The magnitude of s may not be represented exactly by the floating point value.
val of_mtime_span : Mtime.Span.t -> tof_mtime_span span is a span from the monotonic span span.
val to_mtime_span : t -> Mtime.Span.t optionof_mtime_span span is the absolute value of span as a monotonic span or None if span cannot be represented.
compare d d' is a total order on durations that is compatible with signed time span order.
is_shorter span ~than is true if and only if span lasts stricly less than than.
is_longer span ~than is true if and only if span lasts stricly more than than.
Note. The following functions rollover on overflows.
val pp_d_ps : Stdlib.Format.formatter -> t -> unitpp_d_ps ppf d prints an unspecified, approximative, representation of d on ppf.