package posix-time

  1. Overview
  2. Docs
POSIX time

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.5.1.tar.gz
sha256=691346597f40a741768831b357e1047f8efbd0ad43aef259c97392662173c4d2
md5=ad59443f2ddb3a3c674f67fac28ed303

doc/posix-time/Posix_time/Timespec/index.html

Module Posix_time.Timespec

type t = private {
  1. tv_sec : int64;
  2. tv_nsec : int64;
}

POSIX timespec time specifier with seconds and nanoseconds. A normalized value of type t must have a value of tv_nsec between 0 and 1000000000 (exclusive).

val create : int64 -> int64 -> t

create sec nsec creates a new normalized timespec with sec seconds and nsec nanoseconds.

val add : t -> t -> t

add t1 t2 adds the two timespec values, returning a normalized value

val sub : t -> t -> t

sub t1 t2 subtracts t2 from t1, creating a new normalized time value.

val add_sec : int64 -> t -> t

add_sec s t adds s seconds to t.

val add_nsec : int64 -> t -> t

add_sec ns t adds ns nanoseconds to t.

val sub_sec : int64 -> t -> t

sub_sec s t subtracts s seconds from t.

val sub_nsec : int64 -> t -> t

sub_sec ns t subtracts ns nanoseconds from t.

val compare : t -> t -> int

compare t1 t2 compares the two time values t1 and t2. It returns 0 if t1 is equal to 2, a negative integer if t1 is less than t2, and a positive integer if t1 is greater than t2.