1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
(* v * Copyright INRIA, CNRS and contributors *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
module MiniJson : sig
(** Subtype of Yojson.Safe.t *)
type t = [
| `Intlit of string
| `String of string
| `Assoc of (string * t) list
| `List of t list
]
end
val profile : string -> ?args:(unit -> (string * MiniJson.t) list) -> (unit -> 'a) -> unit -> 'a
(** Profile the given function.
[args] is called only if profiling is active, it is used to
produce additional annotations.
*)
val is_profiling : unit -> bool
type settings =
{ output : Format.formatter
}
val init : settings -> unit
(** Profiling must not be active.
Activates profiling with a fresh state. *)
val finish : unit -> unit
(** Profiling must be active.
Deactivates profiling. *)
type accu
(** Profiling state accumulator. *)
val pause : unit -> accu option
(** Returns [None] if profiling is inactive.
Deactivates profiling if it is active, returning the current state. *)
val resume : accu -> unit
(** Profiling must not be active.
Activates profiling with the given state. *)
|