This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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 Improve time resolution on targets without gettimeofday


Hi Janne,

On 05/23/2012 04:44 PM, Janne Blomqvist wrote:
some targets such as VXWorks don't provide gettimeofday but do provide
clock_gettime. The attached patch allows such targets to get better
resolution for the DATE_AND_TIME (up to the 1 millisecond limit of the
API) intrinsic than the 1 second resolution provided by the current
fallback of using the C standard time().

Ok for trunk? (Patch both inline below and as an attachment)

I concur and wrote essentially the same patch - except that I used a different condition (and forgot to change the comment):


+#elif defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_REALTIME) && !defined(HAVE_CLOCK_GETTIME_LIBRT)

I think in practice it shouldn't matter as librt* mostly affects GLIBC which has gettimeofday. Plus I believe CLOCK_REALTIME should be always available and only CLOCK_MONOTONIC is unimplemented on some systems (e.g. on VxWorks 5.5 but not on 6.x according to the documentation).

(* = In intrinsics/system_clock.c, weak refs are used for librt; for gf_gettime that's an overkill and a simple time() as fall back is sufficient.)

Okay with considering my preprocessor condition.

Tobias

PS: In Thunderbird, the attachment is shown as inline. Thus, from my side, it is sufficient to just keep the attachment.


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