Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 12/16/2022
Public

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

Document Table of Contents

second/dsecnd

Returns elapsed time in seconds. Use to estimate real time between two calls to this function.

Syntax

val = second()

val = dsecnd()

Include Files
  • mkl.fi
Description

The second/dsecnd function returns time in seconds to be used to estimate real time between two calls to the function. The difference between these functions is in the precision of the floating-point type of the result: while second returns the single-precision type, dsecnd returns the double-precision type.

Use these functions to measure durations. To do this, call each of these functions twice. For example, to measure performance of a routine, call the appropriate function directly before a call to the routine to be measured, and then after the call of the routine. The difference between the returned values shows real time spent in the routine.

Initializations may take some time when the second/dsecnd function runs for the first time. To eliminate the effect of this extra time on your measurements, make the first call to second/dsecnd in advance.

Do not use second to measure short time intervals because the single-precision format is not capable of holding sufficient timer precision.

Return Values

Name

Type

Description

val

REAL for second
DOUBLE PRECISION for dsecnd

Elapsed real time in seconds