if profiling_enabled && enable then
function s ->
let total = ref 0.0 in
+ let calls = ref 0 in
let profile f x =
let before = Unix.gettimeofday () in
try
+ incr calls;
let res = f x in
let after = Unix.gettimeofday () in
total := !total +. (after -. before);
(fun () ->
if !profiling_printings () && !total <> 0. then
prerr_endline
- ("!! TOTAL TIME SPENT IN " ^ s ^ ": " ^ string_of_float !total));
+ ("!! TOTAL TIME SPENT IN " ^ s ^ " ("^string_of_int !calls^"): " ^ string_of_float !total));
{ profile = profile }
else
function _ -> { profile = fun f x -> f x }