Skip to content

SpanTotalMilliseconds

See Also: Time and Date Functions

Purpose

Calculates the total number of milliseconds in the time span.

Return Type

Real

Syntax

(SpanTotalMilliseconds( {tsVar} ))

Parameters

What it Does

The SpanTotalMilliseconds function calculates the total number of milliseconds 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 milliseconds. The process is whatever code the DoSomething method executes.

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

Procedure TestSpanTotalMilliseconds
    DateTime dtVar1 dtVar2
    TimeSpan tsVar

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

    Showln "The total milliseconds between " dtVar1 " and " dtVar2 " are " (SpanTotalMilliseconds(tsVar))
End_Procedure