let time_fun f x =
  let begin_time = now () in
  let res = f x in
    (now () -. begin_time, res)