Hi Akim,

There are three issues with this patch:

1) Portability. As listed in
https://www.gnu.org/software/gnulib/manual/html_node/clock_005fgettime.html
Gnulib provides no replacement for clock_gettime. So, you'll probably need
gettimeofday or module 'gettime' as fallback.

For clock_gettime, you can use the Gnulib module 'clock-time' for the m4
macros.

2) Precision. When you use gettimeofday, the starting point is 1970, thus
the number of microseconds stored in the 'wall' field will be around
1.6e15, thus when stored as 'float' the precision will be in the range of
3 to 10 minutes. A program which runs for less than a minute will have
wall clock difference of 0 with high probability.
=> The 'wall' field should better be a 'double'.

Or possibly solve both problems at once by using the Gnulib module
'gethrxtime', and 'xtime_t' instead of 'float' for the 'wall' field.
Or 'gettime'. I don't know how 'gettime' compares against 'gethrxtime'.

3) Link dependency: List the link dependencies, like it's done e.g. in
the 'clock-time', 'gettime', and 'gethrxtime' modules. Also use these
dependencies when linking the test program (in module 'timevar-tests').

Bruno


Reply via email to