Lahey/Fujitsu Fortran

CPU_TIME Subroutine

Description

The CPU_TIME subroutine returns the amount of processor time used by a program, expressed as a REAL number.

Syntax

CPU_TIME (time)

Required Arguments

time is an INTENT(OUT) scalar REAL variable. It is assigned the processor time in seconds.

Remarks

CPU_TIME only reflects the actual CPU usage when the application is executed in an environment that makes this information available. Windows NT, 2000, XP and Linux systems support this facility. If the operating system does not track CPU usage, CPU_TIME returns the elapsed time between calls.

Example

integer :: i real :: start_time,end_time, x(1000000) call cpu_time(start_time) do i=1,1000000 x=cosh(real(i)) end do call cpu_time(end_time) write(*,*) end_time-start_time ! writes elapsed time