Posix_time2.Timespec
POSIX timespec: time with nanosecond precision.
type t = private {
tv_sec : int64;
tv_nsec : int64;
}
Time value with seconds and nanoseconds. A normalized value has tv_nsec between 0 and 999999999 (inclusive).
tv_nsec
0
999999999
val create : int64 -> int64 -> t
create sec nsec creates a new normalized timespec.
create sec nsec
val add : t -> t -> t
add t1 t2 adds two timespec values, returning a normalized result.
add t1 t2
val sub : t -> t -> t
sub t1 t2 subtracts t2 from t1, returning a normalized result.
sub t1 t2
t2
t1
val add_sec : int64 -> t -> t
add_sec s t adds s seconds to t.
add_sec s t
s
t
val add_nsec : int64 -> t -> t
add_nsec ns t adds ns nanoseconds to t.
add_nsec ns t
ns
val sub_sec : int64 -> t -> t
sub_sec s t subtracts s seconds from t.
sub_sec s t
val sub_nsec : int64 -> t -> t
sub_nsec ns t subtracts ns nanoseconds from t.
sub_nsec ns t
val to_string : t -> string
to_string t returns a string in the form "sec.nsec".
to_string t
"sec.nsec"
val compare : t -> t -> int
compare t1 t2 compares two time values. Returns 0 if equal, negative if t1 < t2, positive if t1 > t2.
compare t1 t2
t1 < t2
t1 > t2