## D.1.6 SECNDS Function

The SECNDS function returns the system time in seconds as a single- precision, floating-point value, minus the value of its single- precision, floating-point argument. The call to SECNDS takes the following form:

    y = SECNDS (x)

y
  Is set equal to the time in seconds since midnight, minus the user-supplied value of x.

The SECNDS function can perform elapsed-time computations. For example:

    C    START OF TIMED SEQUENCE

         T1 = SECNDS(0.0)

    C    CODE TO BE TIMED

         DELTA = SECNDS(T1)

DELTA gives the elapsed time.

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

The time is computed from midnight. The SECNDS function also produces correct results for time intervals that span midnight.

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

For More Information:

For details on OpenVMS Run-Time Library procedures, see the OpenVMS RTL Library (LIB$) Manual.

Previous Page Next Page Table of Contents