package apero-time

  1. Overview
  2. Docs
OCaml Time Stamping Library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.4.7.tar.gz
sha256=8a3d441b43fe3cac23026cd83dea448ed7565ed8fc7e1d7cd7369e4967164e98
sha512=6232e9b96a3b8de8ccdf9881c6c07b11b0cf521cf8f42df2e582a7b020e2c209dfb73741d1e8c339c0d907c2f8a27b0f8f48d86177483239865dfb459b8ead01

doc/apero-time/Apero_time/HLC/Make/index.html

Module HLC.Make

Parameters

module Clk : sig ... end

Signature

module Time : sig ... end
module Timestamp : Timestamp.Timestamp.S
type t
val create : ?csize:int -> ?delta:Time.t -> Apero.Uuid.t -> t

create ?csize ?delta id creates a new HLC using id as source identifier. csize specifies the size of the counter part used within the 64-bit time represnetation (default: 8 bits). delta specifies the maximum time drift accepted wrt. local time for an incoming timestamp (default: 100ms).

val new_timestamp : t -> Timestamp.t Lwt.t

new_timestamp () updates the HLC with the local time and returns a new Timestamp which is greater than any previously returned timestamp

val update_with_timestamp : Timestamp.t -> t -> (unit, Apero.error) Apero.Result.t Lwt.t

update_with_timestamp t checks if the timestamp t (that should come from an incoming message) doesn't exceeds the local time above the specified Config.delta. If not, the HLC is updated with this timestamps and will further create timestamps that are greater thant t and than any previously returned timestamp.