This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR 53456 More CPU timing fallbacks

On 05/23/2012 10:43 PM, Janne Blomqvist wrote:
the attached patch allows the use of clock_gettime() with
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.


Such a target is apparently
VxWorks 6.something, see

Ok for trunk?

2012-05-23 Janne Blomqvist<>

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]