The results with getrusage are indeed much more precise.
This is with times.
$ ./_build/7s/tests/bison --trace=time ~/Downloads/Z280/asm1a.y
asm1a2.y: avertissement: 33 conflits par décalage/réduction [-Wconflicts-sr]
Execution times (seconds)
reader : 0,0100 ( 2%) usr 0,0000 ( 0%) sys 0,0000 ( 0%) wall
LR(0) : 0,0100 ( 2%) usr 0,0000 ( 0%) sys 0,0000 ( 0%) wall
outputting report : 0,0300 ( 7%) usr 0,0000 ( 0%) sys 0,0000 ( 0%) wall
parser action tables : 0,0200 ( 4%) usr 0,0000 ( 0%) sys 0,0000 ( 0%) wall
outputting parser : 0,0100 ( 2%) usr 0,0000 ( 0%) sys 0,0000 ( 0%) wall
running m4 : 0,3700 (82%) usr 0,0000 ( 0%) sys 0,0000 ( 0%) wall
total time : 0,45 0,00 0,00
This is with getrusage.
$ ./_build/7s/tests/bison --trace=time ~/Downloads/Z280/asm1a.y
asm1a2.y: avertissement: 33 conflits par décalage/réduction [-Wconflicts-sr]
Execution times (seconds)
reader : 0,0163 ( 4%) usr 0,0016 (19%) sys
outputting report : 0,0273 ( 6%) usr 0,0013 (16%) sys
parser action tables : 0,0184 ( 4%) usr 0,0001 ( 1%) sys
outputting parser : 0,0109 ( 2%) usr 0,0010 (12%) sys
running m4 : 0,3794 (83%) usr 0,0040 (47%) sys
total time : 0,46 0,01
Weirdly enough though, some phases in Bison now completely
disappear. From the report. For instance, LR(0) that we see
almost at each run with time never shows with getrusage.
Also, I wrote something completely wrong:
> - getrusage offers two choices:
> - RUSAGE_SELF: the calling process and its threads.
> - RUSAGE_CHILDREN: main and subprocesses that have been wait’ed.
No, RUSAGE_CHILDREN is _only_ about the children. Two calls are needed
to get self + children.