From: Enrico Tassi Date: Tue, 21 Mar 2006 17:40:53 +0000 (+0000) Subject: added calls number X-Git-Tag: make_still_working~7479 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=9d37f725a8c150d2a9e20b24495e0cfdc7969ee6;hp=9ec9bec67c97942a048fe930faa53472754457c9;p=helm.git added calls number --- diff --git a/helm/software/components/extlib/hExtlib.ml b/helm/software/components/extlib/hExtlib.ml index 93eabf2ac..4296db49b 100644 --- a/helm/software/components/extlib/hExtlib.ml +++ b/helm/software/components/extlib/hExtlib.ml @@ -37,9 +37,11 @@ let profile ?(enable = true) = 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); @@ -54,7 +56,7 @@ let profile ?(enable = true) = (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 }