package async_kernel

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

Source file time_ns.ml

1
2
3
4
5
6
7
8
9
10
11
include Core_kernel.Core_kernel_private.Time_ns_alternate_sexp

(* [after] is like [add], but deals nicely with the case of overflow by instead returning
   [max_value].  Time-source functions use [after] to avoid immediately firing events that
   should never fire, due to the overflow leading to a negative time that appears to be in
   the past.  We don't check underflow because that is very unlikely, requiring both a
   negative time and a negative span. *)
let after t span =
  let result = add t span in
  if Span.( > ) span Span.zero && result < t then max_value_for_1us_rounding else result
;;
OCaml

Innovation. Community. Security.