let table = Hashtbl.create 103 let summary fmt = Logger.start_msg fmt "[Stats] Function profiling:"; Logger.msg fmt "@\n @["; Hashtbl.iter (fun (m, f) d -> let c, tl = !d in let tspent = List.fold_left (fun acc e -> e +. acc) 0. tl in Logger.msg fmt "%s: %s = called %i times, total: %fms, average: %fms@\n" m f c tspent (tspent /. (float_of_int c))) table; Logger.end_msg Format.err_formatter "\n\n"