Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

ETIME

Portability Function: On single processor systems, returns the elapsed CPU time, in seconds, of the process that calls it. On multi-core or multi-processor systems, returns the elapsed wall-clock time, in seconds.

Module

USE IFPORT

result = ETIME (array)

array

(Output) REAL(4). Must be a rank one array with two elements:

  • array(1) − Elapsed user time, which is time spent executing user code. This value includes time running protected Windows subsystem code. On single processors, ETIME returns the elapsed CPU time, in seconds, of the process that calls it. On multiple processors, ETIME returns the elapsed wall-clock time, in seconds.

  • array(2) − Elapsed system time, which is time spent executing privileged code (code in the Windows Executive) on single processors; on multiple processors, this value is zero.

Results

The result type is REAL(4). The result is the total CPU time, which is the sum of array(1) and array(2).

Example

 USE IFPORT
 REAL(4) I, TA(2)
 I = ETIME(TA)
 write(*,*) 'Program has used', I, 'seconds of CPU time.'
 write(*,*) '  This includes', TA(1), 'seconds of user time and',  &
& TA(2), 'seconds of system time.'

See Also