| 0 -> []
| _ -> (Cic.Rel (howmany + from)) :: (mk_rels (howmany-1) from)
-let profiling_enabled = false
+let profiling_enabled = true
type profiler = { profile : 'a 'b. ('a -> 'b) -> 'a -> 'b }
let profile =
let total = ref 0.0 in
let profile f x =
let before = Unix.gettimeofday () in
- let res = f x in
- let after = Unix.gettimeofday () in
- total := !total +. (after -. before);
- res
+ try
+ let res = f x in
+ let after = Unix.gettimeofday () in
+ total := !total +. (after -. before);
+ res
+ with
+ exc ->
+ let after = Unix.gettimeofday () in
+ total := !total +. (after -. before);
+ raise exc
in
at_exit
(fun () ->