package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.5.tbz
sha512=00a6868b4dfa34565d0141b335622a81a0e8d5b9e3c6dfad025dabfa3df2db2a1302b492953bbbce30c3a4406c324fcec25250a00b38f6d18a69e15605e3b07e

doc/b0.std/B0_std/Os/Mtime/index.html

Module Os.MtimeSource

Monotonic time clock and sleep.

See B0_std.Mtime for a discussion about monotonic time.

Monotonic clock

Sourceval now : unit -> Mtime.t

now () is the current system-relative monotonic timestamp. Its absolute value is meaningless.

Sourceval elapsed : unit -> Mtime.span

elapsed () is the monotonic time span elapsed since the beginning of the program.

Monotonic wall-clock time counters

Sourcetype counter

The type for monotonic wall-clock time counters.

Sourceval counter : unit -> counter

counter () is a counter counting from now on.

Sourceval count : counter -> Mtime.span

count c is the monotonic time span elapsed since c was created.

Error handling

The functions elapsed, now, counter, raise Sys_error whenever they can't determine the current time or that it doesn't fit in Mtime's range. Usually this exception should only be catched at the toplevel of your program to log it and abort the program. It indicates a serious error condition in the system.

Platform support