Do not print number of runs/average/min/max timing when a function
authorKim Nguyễn <kn@lri.fr>
Sun, 21 Oct 2012 10:25:07 +0000 (12:25 +0200)
committerKim Nguyễn <kn@lri.fr>
Sun, 21 Oct 2012 10:25:07 +0000 (12:25 +0200)
is only timed once.

src/utils.ml

index 3832998..2cb3c41 100644 (file)
@@ -84,6 +84,16 @@ module Timing =
       in
       Logger.verbose fmt "@[%s%s: [" sub msg;
       Format.pp_open_vbox fmt (2 + String.length msg + String.length sub);
+      if len <= 1 then
+      Logger.verbose fmt
+        "@\n\
+| Time        :   %fms@\n\
+| Memory before:  %a@\n\
+| Memory after:   %a@\n]@]@]@\n"
+        tmin
+        System.pr_mem_status memo
+        System.pr_mem_status memn
+      else
       Logger.verbose fmt
         "@\n\
 | Number of runs: %i@\n\
@@ -128,7 +138,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;