summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSon Ho2022-10-21 11:44:35 +0200
committerSon HO2022-10-26 10:42:07 +0200
commit7f2f06918e9326138097bc91a8cf1eb7a0af2a9d (patch)
tree48ac04a47c5d43efc92534643e5af7c25d748bd7
parentb4be489e7a5753bcc7f8714273ae71260fac53ce (diff)
Measure and display the execution time
Diffstat (limited to '')
-rw-r--r--src/main.ml12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.ml b/src/main.ml
index b7868722..05e96af9 100644
--- a/src/main.ml
+++ b/src/main.ml
@@ -22,6 +22,9 @@ Usage: %s [OPTIONS] FILE
Sys.argv.(0)
let () =
+ (* Measure start time *)
+ let start_time = Unix.gettimeofday () in
+
(* Read the command line arguments *)
let dest_dir = ref "" in
let decompose_monads = ref false in
@@ -139,6 +142,7 @@ let () =
pure_micro_passes_log#set_level EL.Info;
pure_to_extract_log#set_level EL.Info;
translate_log#set_level EL.Info;
+
(* Load the module *)
let json = Yojson.Basic.from_file filename in
match llbc_crate_of_json json with
@@ -192,4 +196,10 @@ let () =
use_state = not !no_state;
}
in
- Translate.translate_module filename dest_dir trans_config m
+ Translate.translate_module filename dest_dir trans_config m;
+
+ (* Print total elapsed time *)
+ log#linfo
+ (lazy
+ (Printf.sprintf "Total execution time: %f seconds"
+ (Unix.gettimeofday () -. start_time)))