Developer Guide and Reference

ID 767251
Date 10/31/2024
Public
Document Table of Contents

DCLOCK

Portability Function: Returns the elapsed time in seconds since the start of the current process.

Module

USE IFPORT

result = DCLOCK( )

Results

The result type is REAL(8). This routine provides accurate timing to the nearest millisecond (Windows) or to the nearest microsecond (Linux), taking into account the frequency of the processor where the current process is running.

Note that the first call to DCLOCK performs calibration.

Example

USE IFPORT
DOUBLE PRECISION START_TIME, STOP_TIME
START_TIME = DCLOCK()
CALL FOO()
STOP_TIME = DCLOCK()
PRINT *, 'foo took:', STOP_TIME - START_TIME, 'seconds.'