Returns integer data from a real-time clock.
If you specify a microsecond resolution using -qsclk=micro, the value of COUNT_RATE is 1 000 000 clock counts per second.
If you specify a microsecond resolution using -qsclk=micro and a default of INTEGER(4), the value of COUNT_MAX is 1 799 999 999 clock counts, or about 30 minutes.
If you specify a microsecond resolution using -qsclk=micro and a default of INTEGER(8), the value of COUNT_MAX is 8 639 999 999 clock counts, or about 24 hours.
Class
Subroutine
+-------------------------------IBM Extension--------------------------------+
Examples
In the following example, the clock is a 24-hour clock. After the call to SYSTEM_CLOCK, the COUNT contains the day time expressed in clock ticks per second. The number of ticks per second is available in the COUNT_RATE. The COUNT_RATE value is implementation dependent.
INTEGER, DIMENSION(8) :: IV
TIME_SYNC: DO
CALL DATE_AND_TIME(VALUES=IV)
IHR = IV(5)
IMIN = IV(6)
ISEC = IV(7)
CALL SYSTEM_CLOCK(COUNT=IC, COUNT_RATE=IR, COUNT_MAX=IM)
CALL DATE_AND_TIME(VALUES=IV)
IF ((IHR == IV(5)) .AND. (IMIN == IV(6)) .AND. &
(ISEC == IV(7))) EXIT TIME_SYNC
END DO TIME_SYNC
IDAY_SEC = 3600*IHR + IMIN*60 + ISEC
IDAY_TICKS = IDAY_SEC * IR
IF (IDAY_TICKS /= IC) THEN
STOP 'clock error'
ENDIF
END
+----------------------------End of IBM Extension----------------------------+
Related Information
See the -qsclk compiler option in the User's Guide for more information on specifying system clock resolution.