X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Flib%2Ftime.ml;h=42d7d39a7be4abe740328657978bdf13821b28bb;hb=826883e023c178930ca3dd69567eac23f15ef9c4;hp=2ea295a85715817fe34128c3eaf8aa8898b3813e;hpb=973b0b1fd5f44b96a3c367a9756f28b75b9fa30b;p=helm.git diff --git a/helm/software/lambda-delta/lib/time.ml b/helm/software/lambda-delta/lib/time.ml index 2ea295a85..42d7d39a7 100644 --- a/helm/software/lambda-delta/lib/time.ml +++ b/helm/software/lambda-delta/lib/time.ml @@ -1,20 +1,34 @@ +(* + ||M|| This file is part of HELM, an Hypertextual, Electronic + ||A|| Library of Mathematics, developed at the Computer Science + ||T|| Department, University of Bologna, Italy. + ||I|| + ||T|| HELM is free software; you can redistribute it and/or + ||A|| modify it under the terms of the GNU General Public License + \ / version 2 or (at your option) any later version. + \ / This software is distributed as is, NO WARRANTY. + V_______________________________________________________________ *) + +module P = Printf +module L = Log + let utime_stamp = let old = ref 0.0 in fun msg -> let times = Unix.times () in let stamp = times.Unix.tms_utime in let lap = stamp -. !old in - Printf.printf "UTIME STAMP (%s): %f (%f)\n" msg stamp lap; flush stdout; + L.warn (P.sprintf "USR TIME STAMP (%s): %f (%f)" msg stamp lap); old := stamp let gmtime msg = let gmt = Unix.gmtime (Unix.time ()) in let yy = gmt.Unix.tm_year + 1900 in - let mm = gmt.Unix.tm_mon in + let mm = gmt.Unix.tm_mon + 1 in let dd = gmt.Unix.tm_mday in let h = gmt.Unix.tm_hour in let m = gmt.Unix.tm_min in let s = gmt.Unix.tm_sec in - Printf.printf "UTC TIME STAMP (%s): %u/%u/%u %u:%u:%u\n" - msg yy mm dd h m s; - flush stdout + L.warn ( + P.sprintf "UTC TIME STAMP (%s): %u/%u/%u %u:%u:%u" msg yy mm dd h m s + )