summaryrefslogtreecommitdiff
path: root/lib/timevar.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* Update some URLsPaul Eggert2019-09-221-1/+1
| | | | | | This is a clerical change that mostly changes http: to https: in URLs where either will work. It also updates some URLs that have moved, removes some URLs that no longer work, and fixes related text.
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* timevar: use gethrxtime to get wall clock timeAkim Demaille2018-10-141-36/+29
| | | | | | | | | | | | | | | | | 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.
* timevar: improve the output formatAkim Demaille2018-10-131-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | From: Execution times (seconds) reader : 0,01 ( 3%) usr 0,00 (16%) sys 0,00 ( 0%) wall outputting report : 0,03 ( 6%) usr 0,00 (15%) sys 0,00 ( 0%) wall parser action tables : 0,02 ( 4%) usr 0,00 ( 2%) sys 0,00 ( 0%) wall outputting parser : 0,01 ( 2%) usr 0,00 (13%) sys 0,00 ( 0%) wall running m4 : 0,37 (84%) usr 0,00 (50%) sys 0,00 ( 0%) wall total time : 0,44 0,01 0,00 To: Execution times (seconds) CPU user CPU system wall clock reader 0,020 ( 4%) 0,002 ( 9%) 0,000000 ( 0%) outputting report 0,029 ( 6%) 0,002 (11%) 0,000000 ( 0%) parser action tables 0,020 ( 4%) 0,001 ( 6%) 0,000000 ( 0%) outputting parser 0,014 ( 3%) 0,002 (10%) 0,000000 ( 0%) running m4 0,431 (83%) 0,012 (59%) 0,000000 ( 0%) total time 0,522 0,020 0,000000 Suggested by Bruno Haible. See https://lists.gnu.org/archive/html/bug-gnulib/2018-10/msg00040.html. * lib/timevar.c (timevar_print): Use %7.3f for usr/sys and %11.6f for wall, since its resolution is much higher.
* timevar: expect that getrusage is availableAkim Demaille2018-10-131-80/+9
| | | | | | | | | | | | | | | Don't keep both times and getrusage as backend: both are guaranteed by gnulib, a single one suffices. Using getrusage is open to possibly tracking other types of resources in the future. * modules/timevar (Depends-on): Add getrusage. (configure.ac): Remove gl_TIMEVAR. (Files): Remove m4/timevar.m4. * m4/timevar.m4: Remove, rely on gnulib for getrusage. * lib/timevar.h (timevar_enabled): Clarify documentation. * lib/timevar.c: Remove all the code about times. Remove all the CPP guards about getrusage: expect it to be present (courtesy of gnulib).
* timevar: rely on gnulib modules for time portability.Akim Demaille2018-10-051-34/+3
| | | | | | | | | | | * modules/timevar (Depends-on): Add sys_time, sys_times, and times. * m4/timevar.m4: Don't check for clock_t and struct tms, guaranteed by gnulib. * lib/timevar.h: Use extern "C" protection. Include <stdio.h> for FILE. * lib/timevar.c: Include sys/time.h, sys/times.h unconditionally, they are guaranteed by gnulib. Remove uses of clock as (now useless) fallback.
* timevar: Small tweaks.Bruno Haible2018-09-301-2/+3
| | | | | | | | * lib/timevar.h: Fix comments. Add parameter names to function declarations. * lib/timevar.c: Include timevar.h immediately after config.h. * lib/timevar.def: Fix comments. * modules/timevar (Maintainer): List Akim Demaille.
* timevar: import from Bison.Akim Demaille2018-09-291-0/+456
* m4/timevar.m4, modules/timevar, lib/timevar.h, lib/timevar.c: New files. * lib/timevar.def: New file. * doc/timevar.texi: New file.