diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/profile.ml | 8 | ||||
| -rw-r--r-- | lib/profile.mli | 5 |
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/profile.ml b/lib/profile.ml index d154478177..cde5ed5999 100644 --- a/lib/profile.ml +++ b/lib/profile.ml @@ -15,8 +15,7 @@ let float_of_time t = float_of_int t /. 100. let time_of_float f = int_of_float (f *. 100.) let get_time () = - let {Unix.tms_utime = ut;Unix.tms_stime = st} = Unix.times () in - time_of_float (ut +. st) + time_of_float (Sys.time ()) (* Since ocaml 3.01, gc statistics are in float *) let get_alloc () = @@ -155,7 +154,10 @@ let merge_profile filename (curr_table, curr_outside, curr_total as new_data) = (* Unix measure of time is approximative and shoitt delays are often unperceivable; therefore, total times are measured in one (big) step to avoid rounding errors and to get the best possible - approximation *) + approximation. + Note: Sys.time is the same as: + Unix.(let x = times () in x.tms_utime +. x.tms_stime) + *) (* ---------- start profile for f1 diff --git a/lib/profile.mli b/lib/profile.mli index 5bcebfb0dd..56f78cba8a 100644 --- a/lib/profile.mli +++ b/lib/profile.mli @@ -8,12 +8,9 @@ (** {6 This program is a small time and allocation profiler for Objective Caml } *) -(*i It requires the UNIX library *) - (** Adapted from Christophe Raffalli *) -(** To use it, link it with the program you want to profile (do not forget -"-cclib -lunix -custom unix.cma" among the link options). +(** To use it, link it with the program you want to profile. To trace a function "f" you first need to get a key for it by using : |
