SYSTEM_CLOCK intrinsic subroutine
Standard: F77 (F90) F95 F2003 F2008   Example Program
<Syntax>

Call SYSTEM_CLOCK ( [ COUNT, COUNT_RATE, COUNT_MAX ] )

COUNT : Integer scalar, Intent(Out);
COUNT_RATE : Real or Integer scalar, Intent(Out);
COUNT_MAX : Integer scalar, Intent(Out).

Note that in Fortran 90, all arguments were required to be Integer with default kind.

<Semantics>

This subroutine queries the real-time system clock. This is a clock that counts from zero to COUNT_MAX at a rate of COUNT_RATE ticks per second; after reaching COUNT_MAX it restarts from zero.

COUNT is assigned the current clock value in the range zero to COUNT_MAX, or −HUGE(COUNT) if there is no clock.

COUNT_RATE is assigned the number of clock ticks per second, or zero if there is no clock.

COUNT_MAX is assigned the maximum clock value, or zero if there is no clock.

On Windows, this uses the high-precision performance clock; this clock is very precise and very accurate, but if 32-bit arguments are used it will usually reach COUNT_MAX (and thus reset to zero) every 10-20 minutes depending on the hardware. Therefore it is recommended to use 64-bit integer arguments.

Note that all arguments are optional.

<Related>
CPU_TIME intrinsic subroutine, DATE_AND_TIME intrinsic subroutine.