From e6708c10ad615233628900902101216cc2f5baf5 Mon Sep 17 00:00:00 2001 From: Andrea Asperti Date: Tue, 31 May 2005 09:40:51 +0000 Subject: [PATCH] added chronometer --- helm/matita/matitac.ml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/helm/matita/matitac.ml b/helm/matita/matitac.ml index 607fe703b..ef0ab5a99 100644 --- a/helm/matita/matitac.ml +++ b/helm/matita/matitac.ml @@ -50,7 +50,6 @@ let scripts = List.rev !acc let run_script fname = - MatitaLog.message (sprintf "execution of %s started:" fname); let is = Stream.of_channel (match fname with @@ -85,8 +84,22 @@ let run_script fname = let _ = List.iter (fun fname -> + let time = Unix.time () in + MatitaLog.message (sprintf "execution of %s started:" fname); run_script fname; - MatitaLog.message (sprintf "execution of %s completed." fname)) scripts; + let elapsed = Unix.time () -. time in + let tm = Unix.gmtime elapsed in + let sec = + if tm.Unix.tm_sec > 0 then (string_of_int tm.Unix.tm_sec ^ "''") else "" + in + let min = + if tm.Unix.tm_min > 0 then (string_of_int tm.Unix.tm_min ^ "' ") else "" + in + let hou = + if tm.Unix.tm_hour > 0 then (string_of_int tm.Unix.tm_hour ^ "h ") else "" + in + MatitaLog.message + (sprintf "execution of %s completed in %s." fname (hou^min^sec))) scripts; Http_getter.sync_dump_file (); exit(0) -- 2.39.2