summaryrefslogtreecommitdiff
path: root/lib/Camlcoq.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Camlcoq.ml')
-rw-r--r--lib/Camlcoq.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Camlcoq.ml b/lib/Camlcoq.ml
index 929b61e..ca48341 100644
--- a/lib/Camlcoq.ml
+++ b/lib/Camlcoq.ml
@@ -363,6 +363,16 @@ let time3 name fn arg1 arg2 arg3 =
add_to_timer name (Unix.gettimeofday() -. start);
raise x
+let time4 name fn arg1 arg2 arg3 arg4 =
+ let start = Unix.gettimeofday() in
+ try
+ let res = fn arg1 arg2 arg3 arg4 in
+ add_to_timer name (Unix.gettimeofday() -. start);
+ res
+ with x ->
+ add_to_timer name (Unix.gettimeofday() -. start);
+ raise x
+
let print_timers () =
Hashtbl.iter
(fun name time -> Printf.printf "%-20s %.3f\n" name time)