From: Claudio Sacerdoti Coen Date: Thu, 13 Apr 2006 11:06:29 +0000 (+0000) Subject: Utime + Systime used in place of gettimeofday. X-Git-Tag: 0.4.95@7852~1517 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=82f9b70bba8b324b0ae42fbcc802bd14bc8d1ba2;p=helm.git Utime + Systime used in place of gettimeofday. --- diff --git a/components/binaries/utilities/test_library.ml b/components/binaries/utilities/test_library.ml index 635b6bbd4..98ade3adb 100644 --- a/components/binaries/utilities/test_library.ml +++ b/components/binaries/utilities/test_library.ml @@ -83,9 +83,14 @@ let _ = Printf.printf "%s " uri; flush stdout; let uri = UriManager.uri_of_string uri in - let before = Unix.gettimeofday () in + let obj,_ = CicEnvironment.get_obj CicUniv.empty_ugraph uri in ignore (Unix.alarm deadline); - ignore (CicTypeChecker.typecheck uri); + CicTypeChecker.typecheck_obj uri obj; + ignore (Unix.alarm 0); + CicEnvironment.remove_obj uri; + let before = Unix.times () in + ignore (Unix.alarm deadline); + ignore (CicTypeChecker.typecheck_obj uri obj); ignore (Unix.alarm 0); let memusage = (Gc.stat ()).Gc.live_words * 4 / 1024 / 1024 in if memusage > 500 then @@ -96,8 +101,8 @@ let _ = let memusage = (Gc.stat ()).Gc.live_words * 4 / 1024 / 1024 in prerr_endline ("DOPO CicEnvironment.empty: " ^ string_of_int memusage ^ "Mb"); end; - let after = Unix.gettimeofday () in - let diff = after -. before in + let after = Unix.times () in + let diff = after.Unix.tms_utime +. after.Unix.tms_stime -. before.Unix.tms_utime -. before.Unix.tms_stime in new_total := !new_total +. diff; Printf.printf "OK %.2f" diff; (match time with