X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Futils.ml;h=7e3bb4bb11d40a86829a70fce3f4378420627b36;hb=refs%2Fheads%2Fmaster;hp=38329987ca4a36bb61eca4c43e0d4a27ed6477b1;hpb=cb728132e1c5cb0a171ee09e9b3ced16da08f796;p=SXSI%2Fxpathcomp.git diff --git a/src/utils.ml b/src/utils.ml index 3832998..7e3bb4b 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -82,22 +82,33 @@ module Timing = om, nm)) (infinity, 0., 0., 0, h, h) l in - Logger.verbose fmt "@[%s%s: [" sub msg; - Format.pp_open_vbox fmt (2 + String.length msg + String.length sub); - Logger.verbose fmt - "@\n\ + Logger.start_msg fmt "[Stats] "; + Logger.msg fmt "%s %s:@\n @[[" sub msg; + begin + if len <= 1 then + Logger.msg fmt + "@\n\ +| Time: %fms@\n" + tmin + else + Logger.msg fmt + "@\n\ | Number of runs: %i@\n\ | Average time: %fms@\n\ | Minimum time: %fms@\n\ -| Maximum time: %fms@\n\ -| Memory before: %a@\n\ -| Memory after: %a@\n]@]@]@\n" - len - (ttotal /. (float_of_int len)) - tmin - tmax +| Maximum time: %fms@\n" + len + (ttotal /. (float_of_int len)) + tmin + tmax + + end; + Logger.msg fmt +"| Memory before: %a@\n\ +| Memory after: %a@\n]@]" System.pr_mem_status memo - System.pr_mem_status memn + System.pr_mem_status memn; + Logger.end_msg fmt "\n\n" let time f ?(count=1) ?(msg="") x = @@ -128,7 +139,7 @@ let time f ?(count=1) ?(msg="") x = Queue.clear _t_queue; List.iter (fun msg' -> let sub = - if msg' <> msg then "(sub-timing) " else "" + if msg' <> msg then "+" else "=" in display_result Format.err_formatter msg' sub (get_timing msg')) pr_stack; end;