diff --git a/core/src/time_ns.ml b/core/src/time_ns.ml index 003e9b4..e1f039e 100644 --- a/core/src/time_ns.ml +++ b/core/src/time_ns.ml @@ -22,6 +22,7 @@ let epoch = Span.zero let add = Span.( + ) let sub = Span.( - ) let diff = Span.( - ) +let since = diff @@ now () let abs_diff t u = Span.abs (diff t u) let max = Span.max let min = Span.min diff --git a/core/src/time_ns_intf.ml b/core/src/time_ns_intf.ml index 89b937b..6568179 100644 --- a/core/src/time_ns_intf.ml +++ b/core/src/time_ns_intf.ml @@ -396,6 +396,9 @@ module type Time_ns = sig (** overflows silently *) val diff : t -> t -> Span.t + (** overflows silently *) + val since : t -> Span.t + (** overflows silently *) val abs_diff : t -> t -> Span.t