let debug = ref false;;
let indent = ref "";;
+let times = ref [];;
let pp s =
if !debug then
prerr_endline (Printf.sprintf "%-20s" !indent ^ " " ^ Lazy.force s)
- else
- ()
;;
let inside c =
- indent := !indent ^ String.make 1 c;
- if !debug then prerr_endline ("{{{" ^ !indent ^ " ")
+ if !debug then
+ begin
+ let time1 = Unix.gettimeofday () in
+ indent := !indent ^ String.make 1 c;
+ times := time1 :: !times;
+ prerr_endline ("{{{" ^ !indent ^ " ")
+ end
;;
let outside ok =
- if !debug then prerr_endline "}}}";
- if not ok then pp (lazy "exception raised!");
- try
- indent := String.sub !indent 0 (String.length !indent -1)
- with
- Invalid_argument _ -> indent := "??"; ()
+ if !debug then
+ begin
+ let time2 = Unix.gettimeofday () in
+ let time1 =
+ match !times with time1::tl -> times := tl; time1 | [] -> assert false in
+ prerr_endline ("}}} " ^ string_of_float (time2 -. time1));
+ if not ok then prerr_endline "exception raised!";
+ try
+ indent := String.sub !indent 0 (String.length !indent -1)
+ with
+ Invalid_argument _ -> indent := "??"; ()
+ end
;;
let ppcontext ~metasenv ~subst c =
" === " ^
NCicPp.ppterm ~metasenv ~subst ~context
(NCicReduction.unwind (k2,e2,t2,s2))));
-pp (lazy (string_of_bool norm1 ^ " ?? " ^ string_of_bool norm2));
+ pp (lazy (string_of_bool norm1 ^ " ?? " ^ string_of_bool norm2));
let relevance = [] (* TO BE UNDERSTOOD
match t1 with
| C.Const r -> NCicEnvironment.get_relevance r