Code Timing

An important parameter in writing large-scale numerical simulation code is to keep track of how much time your calculations take.  One possible way to do this is to use the intrinsic subroutine "CPU_TIME"

{from CVF Manual Pages, corrected}:

Intrinsic Subroutine: Returns a processor-dependent approximation of the processor time in seconds. This is a new intrinsic subroutine in Fortran 95.

Syntax

CALL CPU_TIME (time)

time
Must be scalar and of type real. It is an INTENT(OUT) argument.

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

Examples

Consider the following:


  REAL time_begin, time_end
  ...
  CALL CPU_TIME ( time_begin )
  ...
  CALL CPU_TIME ( time_end )
  PRINT (*,*) 'CPU time of operation was ', time_end - time_begin, ' seconds'