Posix_time2.Timeval
POSIX timeval: time with microsecond precision.
type t = private {
tv_sec : int64;
tv_usec : int64;
}
Time value with seconds and microseconds. A normalized value has tv_usec between 0 and 999999 (inclusive).
tv_usec
0
999999
val create : int64 -> int64 -> t
create sec usec creates a new normalized timeval.
create sec usec
val add : t -> t -> t
add t1 t2 adds two timeval 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_usec : int64 -> t -> t
add_usec us t adds us microseconds to t.
add_usec us t
us
val sub_sec : int64 -> t -> t
sub_sec s t subtracts s seconds from t.
sub_sec s t
val sub_usec : int64 -> t -> t
sub_usec us t subtracts us microseconds from t.
sub_usec us t
val to_string : t -> string
to_string t returns a string in the form "sec.usec".
to_string t
"sec.usec"
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