Skip to content

Commit

Permalink
Add the convenience fun Time_ns.since
Browse files Browse the repository at this point in the history
Signed-off-by: Nick <[email protected]>
  • Loading branch information
theteachr committed May 23, 2024
1 parent d5b4d96 commit aa9b919
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/time_ns.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions core/src/time_ns_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit aa9b919

Please sign in to comment.