Skip to content

SpanTotalSeconds

See Also: Time and Date Functions

Purpose

Calculates the total number of seconds in the time span.

Return Type

Real

Syntax

(SpanTotalSeconds({tsVar}))

Parameters

What it Does

The SpanTotalSeconds function calculates the total number of seconds in the time span and returns a double precision real number of that amount.

Example

This sample shows how to check the time a process takes in seconds. The process is whatever code the DoSomething method executes.

// fictional method
Procedure DoSomething
    // do something
    // for example:
    sleep 4
End_Procedure

Procedure Test
    DateTime dtVar1 dtVar2
    TimeSpan tsVar

    Move (CurrentDateTime()) to dtVar1
    Send DoSomething
    Move (CurrentDateTime()) to dtVar2
    Move (dtVar2 - dtVar1) to tsVar

    Showln "The total seconds between " dtVar1 " and " dtVar2 " are " (SpanTotalSeconds(tsVar))
End_Procedure