Click or drag to resize

Seconds Function

X#
Return the number of seconds that have elapsed since midnight.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax
 FUNCTION Seconds() AS REAL8
Request Example 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:mO:ss.
The smallest resolution depends on the hardware timer tick.
Examples
This example contrasts the value of Time() with Seconds():
X#
1? Time()                    // 10:00:00
2? Seconds()                    // 36000.00
This example uses Seconds() to track elapsed time in seconds:
X#
1LOCAL nStart, nElapsed AS FLOAT
2nStart := Seconds()
3.
4. <paramref name="Statements" />
5.
6nElapsed := Seconds() - nStart
7? "Elapsed: " + NTrim(nElapsed) + " seconds"
See Also