package core_kernel

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Timing_wheel.Alarm_precisionSource

Sourcetype t
include Ppx_compare_lib.Comparable.S with type t := t
Sourceval compare : t -> t -> int
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
include Core.Equal.S with type t := t
Sourceval of_span : Core.Time_ns.Span.t -> t
  • deprecated [since 2018-01] Use [of_span_floor_pow2_ns]
Sourceval of_span_floor_pow2_ns : Core.Time_ns.Span.t -> t

of_span_floor_pow2_ns span returns the largest alarm precision less than or equal to span that is a power of two number of nanoseconds.

Sourceval to_span : t -> Core.Time_ns.Span.t
Sourceval one_nanosecond : t

Constants that are the closest power of two number of nanoseconds to the stated span.

Sourceval about_one_day : t

~19.5 h

Sourceval about_one_microsecond : t

1024 us

Sourceval about_one_millisecond : t

~1.05 ms

Sourceval about_one_second : t

~1.07 s

Sourceval mul : t -> pow2:int -> t

mul t ~pow2 is t * 2^pow2. pow2 may be negative, but mul does not check for overflow or underflow.

Sourceval div : t -> pow2:int -> t

div t ~pow2 is t / 2^pow2. pow2 may be negative, but div does not check for overflow or underflow.

Sourcemodule Unstable : sig ... end

The unstable bin and sexp format is that of Time_ns.Span, with the caveat that deserialization implicitly floors the time span to the nearest power of two nanoseconds. This ensures that the alarm precision that is used is at least as precise than the alarm precision that is stated.