Intel® Fortran Compiler 16.0 User and Reference Guide

SECNDS Portability Routine

Portability Function: Returns the number of seconds that have elapsed since midnight, less the value of its argument. SECNDS can be used as a portability function or as an intrinsic procedure. It is an intrinsic procedure unless you specify USE IFPORT.

Module

USE IFPORT

result = SECNDS (time)

time

(Input) REAL(4). Number of seconds, precise to a hundredth of a second (0.01), to be subtracted.

Results

The result type is REAL(4). The result value is the number of seconds that have elapsed since midnight, minus time, with a precision of a hundredth of a second (0.01).

To start the timing clock, call SECNDS with 0.0, and save the result in a local variable. To get the elapsed time since the last call to SECNDS, pass the local variable to SECNDS on the next call.

Example

 USE IFPORT
 REAL(4) s
 INTEGER(4) i, j
 s = SECNDS(0.0)
 DO I = 1, 100000
    J = J + 1
 END DO
 s = SECNDS(s)
 PRINT *, 'It took ',s, 'seconds to run.'

See Also