package affect
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=b328f6696e60c489da8cc2e8fad0537ca6634a39fc0c5de5840d4f98561f110617ef79ba8285ee8427dd99908c6b3d39114973598cddc5ded91abcce3b91b9a6
doc/affect.unix/Affect_unix/Ptime/Span/index.html
Module Ptime.SpanSource
POSIX time spans.
WARNING. A POSIX time span is not equal to an SI second based time span.
POSIX time spans
The type for signed picosecond precision POSIX time spans. A value of this type represent the POSIX duration between two POSIX timestamps.
of_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.
to_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]
of_int_s secs is a span from the signed integer POSIX second span secs.
to_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.
of_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).
to_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.
of_mtime_span span is a span from the monotonic span span.
of_mtime_span span is the absolute value of span as a monotonic span or None if span cannot be represented.
Predicates
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.
Arithmetic
Note. The following functions rollover on overflows.
Pretty printing
pp_d_ps ppf d prints an unspecified, approximative, representation of d on ppf.