diff --git a/src/util/Profile.ml b/src/util/Profile.ml index c0d6b6ca..76737126 100644 --- a/src/util/Profile.ml +++ b/src/util/Profile.ml @@ -32,6 +32,8 @@ let null_probe = No_probe (* where to print events *) let out_ : backend option ref = ref None +let[@inline] enabled () = match !out_ with Some _ -> true | None -> false + let begin_with_ (module B:BACKEND) name : probe = Probe {name; start=B.get_ts ()} diff --git a/src/util/Profile.mli b/src/util/Profile.mli index ea3bb498..01cbc003 100644 --- a/src/util/Profile.mli +++ b/src/util/Profile.mli @@ -5,6 +5,8 @@ type probe val null_probe : probe +val enabled : unit -> bool + val instant : string -> unit val begin_ : string -> probe