Next: TAN, Previous: SYSTEM, Up: Intrinsic Procedures
SYSTEM_CLOCK — Time functionCOUNT_RATE and COUNT_MAX vary depending on the kind of the arguments. For kind=8 arguments, COUNT represents nanoseconds, and for kind=4 arguments, COUNT represents milliseconds. Other than the kind dependency, COUNT_RATE and COUNT_MAX are constant, however the particular values are specific to gfortran.
If there is no clock, COUNT is set to -HUGE(COUNT), and
COUNT_RATE and COUNT_MAX are set to zero.
When running on a platform using the GNU C library (glibc), or a
derivative thereof, the high resolution monotonic clock is available
only when linking with the rt library. This can be done
explicitly by adding the -lrt flag when linking the
application, but is also done implicitly when using OpenMP.
CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])
| COUNT | (Optional) shall be a scalar of type
INTEGER with INTENT(OUT).
|
| COUNT_RATE | (Optional) shall be a scalar of type
INTEGER with INTENT(OUT).
|
| COUNT_MAX | (Optional) shall be a scalar of type
INTEGER with INTENT(OUT).
|
PROGRAM test_system_clock
INTEGER :: count, count_rate, count_max
CALL SYSTEM_CLOCK(count, count_rate, count_max)
WRITE(*,*) count, count_rate, count_max
END PROGRAM