NewProfilemodule MiniJson : sig ... endmodule Counters : sig ... endval profile : string -> ?args:(unit -> (string * MiniJson.t) list) -> (unit -> 'a) -> unit -> 'aProfile the given function.
args is called only if profiling is active, it is used to produce additional annotations.
val init : settings -> unitProfiling must not be active. Activates profiling with a fresh state.
val pause : unit -> accu optionReturns None if profiling is inactive. Deactivates profiling if it is active, returning the current state.
val resume : accu -> unitProfiling must not be active. Activates profiling with the given state.
type sums = (float * int) CString.Map.tTimings for sub-events: for each event, how long it took and how many times it was called.
val empty_sums : sumsval with_profiling : (unit -> 'a) -> MiniJson.t list * sums * 'aRuns the given function with profiling active and returns the produced events and sum times of subevents.
val insert_results : MiniJson.t list -> sums -> unitProfiling must be active. Outputs the given events and includes the sum times in the current event.
Pretty print a time given in seconds using smaller units as needed.
Custom outputs
Output footer for profile files and flushes the formatter.