Timedesc.Spanval zero : tval make : ?s:int64 -> ?ns:int -> unit -> ts defaults to 0L, ns defaults to 0.
ns may be negative, and is normalized during construction.
Interpretation of provided input is still s + ns, i.e. if you wish to represent "negative (1 second and 500 nanosecond)", then the call could look like make ~s:(-1L) ~ns:(-500).
val make_small : ?s:int -> ?ns:int -> unit -> tWrapper around make
val to_s_ns : t -> int64 * intYields pair (s, ns) where
s is the signed second of the spanns is the unsigned nanosecond offsetThe actual span represented is defined as s * 10^9 + ns in nanosecond regardless of the sign of s.
ns is always >= 0 and < 1_000_000_000.
val to_float_s : t -> floatReturns span in seconds, fraction represents subsecond span.
Representation is the same as result from Unix.gettimeofday.
val of_float_s : float -> tConvert from span in seconds, fraction represents subsecond span
Representation is the same as result from Unix.gettimeofday.
val get_s : t -> int64Yields signed second of span, same as fst (to_s_ns _)
val get_ns_offset : t -> intYields the unsigned nanosecond offset, same as snd (to_s_ns _)
Rounds to nearest second
For round x
x.ns >= 500_000_000, then round x = ceil xround x = floor xval to_string : t -> stringval pp : Stdlib.Format.formatter -> t -> unitmodule For_human : sig ... end