[Bug fortran/37832] System_Clock

kargl at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Oct 15 05:51:00 GMT 2008



------- Comment #1 from kargl at gcc dot gnu dot org  2008-10-15 05:50 -------
You can already get an integer(8) result.

integer(8) ticks,rate
call system_clock(count=ticks,count_rate=rate)
print *, ticks, rate
end

gfc -o z a.f90
./z
           2131173368                 1000

count_rate is determined from either /usr/include/sys/time.h or
/usr/include/time.h.  You need to munge your system header files.

For the record, there is very little OS specific code in the
library, and I would actively oppose putting more OS specific code
in the library.  If you want higher resolution try cpu_time, which
is one of the few routines that has OS specific code.

You can also write your timing routine in C and use ISO C binding
to call that routine.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37832



More information about the Gcc-bugs mailing list