= 1024" x-on:close-sidebar="sidebar=window.innerWidth >= 1024 && true">
package magic-trace
-
magic-trace.magic_trace
-
magic-trace.magic_trace_core
-
-
magic-trace.magic_trace_lib
-
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Intended for use like so:
let min_dur = Magic_trace.Min_duration.of_ns 3_000
let my_fun a b c =
Magic_trace.mark_start ();
(* ... *)
if Magic_trace.Min_duration.over min_dur then Magic_trace.take_snapshot ()
;;
which allows capturing only unusually long executions without adding the ~10us breakpoint overhead on every run while magic-trace is attached.
See also the -duration-thresh
flag for use in combination with this or instead of it if you can tolerate a 10us pause on every call.
val of_ns : int -> t
This involves using and forcing Time_stamp_counter.calibrator
so should probably be done only once at the top level as opposed to every time.
val over : t -> bool
Returns true if the time since mark_start
is over the threshold