X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fprofile.ml;fp=src%2Fprofile.ml;h=a0be76b9521224dea6abfff79bee1ef126991090;hb=6b6491b1c9d8b425110e65dcff44c6d98aa54e10;hp=c43dda67c9ae5de609d6d6e0deea2c7405e83c96;hpb=c24457c0df47a48b78bdfc93c3f2e4585687c639;p=SXSI%2Fxpathcomp.git diff --git a/src/profile.ml b/src/profile.ml index c43dda6..a0be76b 100644 --- a/src/profile.ml +++ b/src/profile.ml @@ -1,11 +1,14 @@ let table = Hashtbl.create 103 let summary fmt = + Logger.start_msg fmt "[Stats] Function profiling:"; + Logger.msg fmt "@\n @["; Hashtbl.iter (fun (m, f) d -> let c, tl = !d in let tspent = List.fold_left (fun acc e -> e +. acc) 0. tl in - Format.fprintf fmt "%s: %s = called %i times, total: %fms, average: %fms\n" + Logger.msg fmt "%s: %s = called %i times, total: %fms, average: %fms@\n" m f c tspent (tspent /. (float_of_int c))) table; - Format.fprintf fmt "%!" + Logger.end_msg Format.err_formatter "\n\n" +