CPU_TIME

Intrinsic Subroutine (Generic): Returns a processor-dependent approximation of the processor time in seconds. This is a new intrinsic procedure in Fortran 95. Intrinsic subroutines cannot be passed as actual arguments.

Syntax

CALL CPU_TIME (time)

time

(Output) Must be scalar and of type real.

If a meaningful time cannot be returned, a processor-dependent negative value is returned.

Example

Consider the following:

REAL time_begin, time_end

...

CALL CPU_TIME ( time_begin )

!

!task to be timed

!

CALL CPU_TIME ( time_end )

PRINT (*,*) 'Time of operation was ', time_end - time_begin, ' seconds'