X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fextlib%2FhExtlib.ml;h=cf43e15a03677cff942a0ece003cc85ab0ff972b;hb=f79c3c7e2053d61e5ee41e92e88c050128c8f68e;hp=ded11b9fea412d5e8c917bf6fb79ebf4fb89b926;hpb=58ee7317b9f877788054b8d6dea6d8d1026a63db;p=helm.git diff --git a/helm/software/components/extlib/hExtlib.ml b/helm/software/components/extlib/hExtlib.ml index ded11b9fe..cf43e15a0 100644 --- a/helm/software/components/extlib/hExtlib.ml +++ b/helm/software/components/extlib/hExtlib.ml @@ -29,8 +29,10 @@ let profiling_enabled = ComponentsConf.profiling +let something_profiled = ref false + let _ = - if profiling_enabled then + if !something_profiled then at_exit (fun _ -> prerr_endline (Printf.sprintf "!! %-39s %6s %9s %9s %9s" @@ -66,9 +68,12 @@ let profile ?(enable = true) s = at_exit (fun () -> if !profiling_printings s && !total <> 0. then + begin + something_profiled := true; prerr_endline (Printf.sprintf "!! %-39s %6d %9.4f %9.4f %9.4f" - s !calls !total !max (!total /. (float_of_int !calls)))); + s !calls !total !max (!total /. (float_of_int !calls))) + end); { profile = profile } else { profile = fun f x -> f x }