Visible to Intel only — GUID: GUID-F7893F31-F5F6-4480-B2D3-D589B9799377
Visible to Intel only — GUID: GUID-F7893F31-F5F6-4480-B2D3-D589B9799377
second/dsecnd
Returns elapsed time in seconds. Use to estimate real time between two calls to this function.
Syntax
float second( void );
double dsecnd( void );
Include Files
- mkl.h
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 |
float for second |
Elapsed real time in seconds |