On 05/23/2012 10:43 PM, Janne Blomqvist wrote:
the attached patch allows the use of clock_gettime() with
CLOCK_PROCESS_CPUTIME_ID or CLOCK_THREAD_CPUTIME_ID if the target
doesn't have getrusage() or times().

It's not completely clear to me whether CLOCK_PROCESS_CPUTIME_ID or even CLOCK_THREAD_CPUTIME_ID are always better than "clock()". In case of VxWorks the answer is probably yes as its clock() returns -1 (no per-process clock exists), though unless there is a thread, the patch won't change the result of -1.

I was wondering whether "call cpu_time()" alias clock_gettime with CLOCK_MONOTONIC would be better. (Returns time since startup in case of VxWorks, but could be also something else like time since the epoch.)

As you patch does not break something, might improve the result in some corner cases, and as CLOCK_MONOTONIC is available via cpu_time:

OK for the trunk.

Tobias

Such a target is apparently
VxWorks 6.something, see
http://www-ad.fnal.gov/controls/micro_p/manuals/vxworks_application_programmers_guide_6.7.pdf

Ok for trunk?

2012-05-23  Janne Blomqvist<j...@gcc.gnu.org>

        PR fortran/53456
        * intrinsics/time_1.h (gf_cputime): Fallback for clock_gettime.

Reply via email to