Module Rpi.Mtime

module Mtime: sig .. end
Monotonic time.

Mtime gives access to the 64-bit free running system timer counter. Note that this time is independent from the CPU speed.


Time spans

type span_us = int64 
The type for time spans in unsigned microseconds.

Passing time

val elapsed_us : unit -> span_us
elapsed () is the number of microseconds elasped since boot time.
val sleep_us : span_us -> unit
sleep_us d blocks and sleeps for d microseconds.


type counter 
The type for counters.
val counter : unit -> counter
counter () is a counter counting from call time on.
val counter_value_us : counter -> span_us
counter_value_us c is the current counter value in microseconds.

Time conversion

val s_to_us : int64
s_to_us is the number of microseconds in one second.
val ms_to_us : int64
ms_to_us is the number of microseconds in one millisecond.