From 31f256a6c02a9c5ce2f8b1117738ff5bc818dc60 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kim=20Nguy=E1=BB=85n?= Date: Sun, 21 Oct 2012 12:25:07 +0200 Subject: [PATCH] Do not print number of runs/average/min/max timing when a function is only timed once. --- src/utils.ml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/utils.ml b/src/utils.ml index 3832998..2cb3c41 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -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; -- 2.17.1