mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-07 03:35:38 -05:00
feat(profile): enabled function
This commit is contained in:
parent
ff77617a5d
commit
f893f14f21
2 changed files with 4 additions and 0 deletions
|
|
@ -32,6 +32,8 @@ let null_probe = No_probe
|
||||||
(* where to print events *)
|
(* where to print events *)
|
||||||
let out_ : backend option ref = ref None
|
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 =
|
let begin_with_ (module B:BACKEND) name : probe =
|
||||||
Probe {name; start=B.get_ts ()}
|
Probe {name; start=B.get_ts ()}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ type probe
|
||||||
|
|
||||||
val null_probe : probe
|
val null_probe : probe
|
||||||
|
|
||||||
|
val enabled : unit -> bool
|
||||||
|
|
||||||
val instant : string -> unit
|
val instant : string -> unit
|
||||||
|
|
||||||
val begin_ : string -> probe
|
val begin_ : string -> probe
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue