(X : sig val profiling : bool end) = struct
open Unix
let u = ref 0.0
let cpt = ref 0.0
let start =
if not (X.profiling) then fun () -> ()
else fun () -> u:=(times()).tms_utime
let pause =
if not (X.profiling) then fun () -> ()
else fun () -> cpt := !cpt +. ((times()).tms_utime -. !u)
let get () =
!cpt
end