Rate This Document
Findability
Accuracy
Completeness
Readability

SYSTEM_CLOCK

CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX]) 

The SYSTEM_CLOCK function can be called twice to calculate the elapsed time, which is the difference between two returned values. The return value of this intrinsic function depends on the implementation of different compilers.

COUNT: Optional output parameter of the Integer type, which indicates the count of the processor clock. The value range is [0, COUNT_MAX]. When the value reaches the maximum value COUNT_MAX, the value starts from 0 again.

COUNT_RATE: Optional output parameter of the Integer or Real type, which indicates the clock rate of the processor.

  • If kind is set to 4 or 2, the value of COUNT_RATE is 1000, and the value of COUNT is in milliseconds. If the count starts from 0, the value of COUNT will restart from 0 after about 25 days.
  • If kind is set to 8 or a larger value, the value of COUNT_RATE is 1000000000, and the value of COUNT is in nanoseconds.

When the input parameters are all integers, the kind values of all the parameters must be the same. kind cannot be set to 1. Otherwise, the return values of COUNT, COUNT_RATE, and COUNT_MAX are all 0.

If the system clock fails to be obtained, the returned result is COUNT=-HUGE(COUNT), COUNT_RATE=0, COUNT_MAX=0.