module Oclock:sig..end
This module gives access to the clock_gettime (2) family of functions to
OCaml programs.
If this module allows programs to get time at real- or CPU-time clocks in
nanoseconds, the actual precision of the clocks might be much coarser.
Also, the resolution of a clock, Oclock.getres should indicate the period of the
timer used for this clock, but the actual precision of the clock greatly
depends on the CPU (watch out for frequency scaling!) and its time source.
You can estimate the precision available on your platform with the shipped
example examples/realtime.
Author(s): Mickaƫl Delahaye
typeclockid =int
val getres : clockid -> int64val gettime : clockid -> int64val settime : clockid -> int64 -> unitInvalid_argument if the clock identifier
is not supported, and a Failure if the call fails for any other reason
(including permission problems).val realtime : clockidval realtime_coarse : clockidCLOCK_REALTIME_COARSE (since 2.6.32)
or FreeBSD equivalent CLOCK_REALTIME_FAST.
If not available, set to Oclock.realtime.val monotonic : clockidval monotonic_coarse : clockidCLOCK_MONOTONIC_COARSE (since 2.6.32)
or FreeBSD equivalent CLOCK_MONOTONIC_FAST.
If not available, set to Oclock.monotonic.val monotonic_raw : clockidOclock.monotonic.val boottime : clockidOclock.monotonic.val process_cputime : clockid optionval thread_cputime : clockid optionval getcpuclockid : int -> clockid
Raises an Invalid_argument exception if the provided integer is not a valid
PID, and a Failure if the calls fails for any other reason (including
permission problems).
val pthread_getcpuclockid : int -> clockidThread.id (but only if you use real POSIX threads -thread
and not VM threads -vmthread).
Raises an Invalid_argument exception if the provided integer is not a valid
thread identifier, and a Failure if the calls fails for any other reason
(including permission problems).