9.3.137 SECNDS (X)

Description:  Provides the system time of day, or elapsed time, as a floating-point value in seconds. SECNDS is not a pure function, so it cannot be referenced inside a FORALL construct.  
Class:  Elemental function; Specific 
Arguments:  X must be of type REAL(4).  
Results:  The result type is the same as X. The result value is the time in seconds since midnight - X. (The function also produces correct results for time intervals that span midnight.)

The value of SECNDS is accurate to 0.01 second, which is the resolution of the system clock.

The 24 bits of precision provide accuracy to the resolution of the system clock for about one day. However, loss of significance can occur if you attempt to compute very small elapsed times late in the day.

On OpenVMS systems, you can get more precise timing information by using the following Run-Time Library (RTL) procedures:

  • LIB$INIT_TIMER

  • LIB$SHOW_TIMER

  • LIB$STAT_TIMER
Examples

The following shows how to use SECNDS to perform elapsed-time computations:

C    START OF TIMED SEQUENCE
     T1 = SECNDS(0.0)

C    CODE TO BE TIMED
     ...
     DELTA = SECNDS(T1)      ! DELTA gives the elapsed time


Previous Page Next Page Table of Contents