]> Savannah Git Hosting - gnulib.git/commit
timevar: use gethrxtime to get wall clock time
authorAkim Demaille <akim.demaille@gmail.com>
Fri, 12 Oct 2018 04:46:09 +0000 (06:46 +0200)
committerAkim Demaille <akim.demaille@gmail.com>
Sun, 14 Oct 2018 13:15:05 +0000 (15:15 +0200)
commitb159aa5da7e1aa7abeb2f77ba644aa164d25a46d
tree49321b66d1e504b9c351cd6f4a99d08b804313ae
parent8ef10eb646873b257e8e84fa140bff88d85f5496
timevar: use gethrxtime to get wall clock time

clock_gettime is not portable.  gethrxtime takes the best available
option to get the wall clock time, including clock_gettime (monotonic
clock), and gettime (non monotonic).
Also, using xtime_t instead of float preserves the precision.
Suggested by Bruno Haible.

* lib/xtime.h (xtime_make): Handle overflows of nanoseconds.
* modules/timevar (Depends-on): We need gethrxtime.
We no longer use times().
(Link): Update.
* lib/timevar.h (timevar_time_def): Use xtime_t.
* lib/timevar.c (set_to_current_time): Use gethrxtime.
(timevar_print): Instead of checking whether the timings themselves
are large enough for the timevar to be printed, check the percentages.
ChangeLog
lib/timevar.c
lib/timevar.h
lib/xtime.h
modules/timevar