X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fprofile.ml;h=a0be76b9521224dea6abfff79bee1ef126991090;hb=4516c5fe48693d769b62b987fe561d9aa8951695;hp=c43dda67c9ae5de609d6d6e0deea2c7405e83c96;hpb=4b52da1a20a4fe031930bb96d2ca46bec06dc529;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" +