Click or drag to resize

Seconds Function

Return the number of seconds that have elapsed since midnight.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax
 FUNCTION Seconds() AS REAL8
View Source

Return Value

Type: Double
The number of seconds that have elapsed since midnight in the form seconds.hundredths.  Numbers range from 0 to 86,399.
Remarks
Seconds() provides a simple method of calculating elapsed time during program execution, based on the system clock.  It is related to the Time() function, which returns the system time in the form hh:mm:ss.  The smallest resolution depends on the hardware timer tick.
Examples
This example contrasts the value of Time() with Seconds():
X#
? Time()                                        // 10:00:00
? Seconds()                                        // 36000.00
This example uses Seconds() to track elapsed time in seconds:
X#
LOCAL nStart, nElapsed AS FLOAT
nStart := Seconds()
.
. <Statements>
.
nElapsed := Seconds() - nStart
? "Elapsed: " + NTrim(nElapsed) + " seconds"
See Also