summary refs log tree commit diff
path: root/source/xi_lib/measure.ml
blob: 1aec0b99c73f5ad0074bbfde1f45033470ab3643 (plain) (blame)
1
2
3
4
5
6
7
8
let logf fmt = Logger.make_logf __MODULE__ fmt

let measure name f =
  let t_start = Unix.gettimeofday () in 
  let r = f () in
  let t_end = Unix.gettimeofday () in
  logf "%s: execution time %f" name (t_end -. t_start);
  r