Description:  Returns integer data from a real-time clock. SYSTEM_CLOCK returns the number of seconds from 00:00 Coordinated Universal Time (CUT) on 1 JAN 1970. The number is returned with no bias. To get the elapsed time, you must call SYSTEM_CLOCK twice, and subtract the starting time value from the ending time value.
Class:  Subroutine 
Arguments:  There are three optional arguments1
COUNT (opt)  Must be scalar and of type default integer. It is set to a value based on the current value of the processor clock. The value is increased by one for each clock count until the value COUNT_MAX is reached, and is reset to zero at the next count. (COUNT lies in the range 0 to COUNT_MAX.) 
COUNT_RATE (opt)  Must be scalar and of type default integer. It is set to the number of processor clock counts per second.

If default integer is INTEGER(2), COUNT_RATE is 1000. If default integer is INTEGER(4), COUNT_RATE is 10000. If default integer is INTEGER(8), COUNT_RATE is 1000000.
COUNT_MAX (opt)  Must be scalar and of type default integer. It is set to the maximum value that COUNT can have, HUGE(0). For more information on HUGE, see Section 9.3.56.  
1 All are INTENT(OUT) arguments. (See Section 5.10.)


Consider the following:

   integer(2) :: ic2, crate2, cmax2
   integer(4) :: ic4, crate4, cmax4
   call system_clock(count=ic2, count_rate=crate2, count_max=cmax2)
   call system_clock(count=ic4, count_rate=crate4, count_max=cmax4)
   print *, ic2, crate2, cmax2
   print *, ic4, crate4, cmax4

This program was run on Thursday Dec 11, 1997 at 14:23:55 EST and produced the following output:

  13880   1000  32767
  1129498807       10000  2147483647

Previous Page Next Page Table of Contents