feat(profile): util with2

This commit is contained in:
Simon Cruanes 2021-04-27 23:04:20 -04:00
parent 784c1dceee
commit a2c397f1e5
2 changed files with 4 additions and 1 deletions

View file

@ -90,6 +90,9 @@ let[@inline] with1 name f x =
exit_with_ b pb;
raise e
let[@inline] with2 name f x y =
with_ name (fun () -> f x y)
module Control = struct
let setup b =
assert (!out_ = None);

View file

@ -14,8 +14,8 @@ val begin_ : string -> probe
val exit : probe -> unit
val with_ : string -> (unit -> 'a) -> 'a
val with1 : string -> ('a -> 'b) -> 'a -> 'b
val with2 : string -> ('a -> 'b -> 'c) -> 'a -> 'b -> 'c
module type BACKEND = sig
val get_ts : unit -> float