LF Fortran 95

SYSTEM_CLOCK Subroutine

Description

The SYSTEM_CLOCK subroutine returns INTEGER data from the real-time clock.

Syntax

SYSTEM_CLOCK ( [count] [, count_rate] [, count_max] )

Optional Arguments

count is an INTENT(OUT) scalar of type default INTEGER. Its value is set to the current value of the processor clock or to -HUGE(0) if no clock is available.

count_rate is an INTENT(OUT) scalar of type default INTEGER. It is set to the number of processor clock counts per second, or to zero if there is no clock.

count_max is an INTENT(OUT) scalar of type default INTEGER. It is set to the maximum value that count can have, or zero if there is no clock.

At least one argument must be present.

Example

integer :: c,cr,cm call system_clock(c,cr,cm) write(*,*) c ! writes current count write(*,*) cr ! writes count rate write(*,*) cm ! writes maximum count possible write(*,*) real(c)/real(cr) ! current count in seconds