Posix_time2POSIX time and clock functions.
This module provides OCaml bindings to POSIX time functions defined in time.h and sys/time.h.
It includes high-precision time structures, clock access, timers, and time conversion functions.
module Timespec : sig ... endPOSIX timespec: time with nanosecond precision.
module Itimerspec : sig ... endInterval timer specification using timespec.
module Timeval : sig ... endPOSIX timeval: time with microsecond precision.
module Tm : sig ... endPOSIX broken-down time structure.
module Itimerval : sig ... endInterval timer value using timeval.
type clock = [ | `RealtimeSystem-wide real-time clock
*)| `MonotonicMonotonic clock that cannot be set
*)| `Process_cputimeCPU time consumed by the process
*)| `Thread_cputimeCPU time consumed by the thread
*) ]Clock identifiers for clock_gettime and related functions. See clock_getres(3).
val asctime : Tm.t -> stringConvert broken-down time to a string. See asctime(3).
val clock_getres : clock -> Timespec.tGet clock resolution. See clock_getres(3).
val clock_gettime : clock -> Timespec.tGet current time from a clock. See clock_gettime(3).
val clock_settime : clock -> Timespec.t -> unitSet a clock's time (requires appropriate privileges). See clock_settime(3).
Convert Unix timestamp to a date/time string. See ctime(3).
val localtime : int64 -> Tm.tConvert Unix timestamp to broken-down local time. See localtime(3).
val nanosleep : Timespec.t -> unitHigh-resolution sleep. See nanosleep(3).
val clock_nanosleep : absolute:bool -> clock:clock -> Timespec.t -> unitHigh-resolution sleep with clock selection. See clock_nanosleep(3).
type itimer = [ | `RealITIMER_REAL: decrements in real time, delivers SIGALRM
*)| `VirtualITIMER_VIRTUAL: decrements in process virtual time, delivers SIGVTALRM
*)| `ProfITIMER_PROF: decrements in process time, delivers SIGPROF
*) ]Interval timer types for getitimer and setitimer. See getitimer(3).
val getitimer : itimer -> Itimerval.tGet the value of an interval timer. See getitimer(3).
val setitimer : itimer -> Itimerval.t -> Itimerval.tSet an interval timer and return its previous value. See setitimer(3).
val gettimeofday : unit -> Timeval.tGet the current time of day. See gettimeofday(3).
val select :
Unix.file_descr list ->
Unix.file_descr list ->
Unix.file_descr list ->
Timeval.t option ->
Unix.file_descr list * Unix.file_descr list * Unix.file_descr listSynchronous I/O multiplexing.
See select(2).