SECNDS Portability Routine

Portability Function: Returns the number of seconds that have elapsed since midnight, less the value of its argument. SECNDS can be used as an intrinsic function or as a portability function. It is an intrinsic procedure unless you specify USE IFPORT.

Module

USE IFPORT

Syntax

result = SECNDS (time)

time

(Input) REAL(4). Number of seconds, precise to a hundredth of a second (0.01), to be subtracted.

Results

The result type is REAL(4). The result value is the number of seconds that have elapsed since midnight, minus time, with a precision of a hundredth of a second (0.01).

To start the timing clock, call SECNDS with 0.0, and save the result in a local variable. To get the elapsed time since the last call to SECNDS, pass the local variable to SECNDS on the next call.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

Example

USE IFPORT

REAL(4) s

INTEGER(4) i, j

s = SECNDS(0.0)

DO I = 1, 100000

J = J + 1

END DO

s = SECNDS(s)

PRINT *, 'It took ',s, 'seconds to run.'

See Also