Navigation:  ThinBASIC Modules > Core (thinBasic Core Engine) > Core Module Classes > cTimer Class > cTimer Methods >

<cTimer>.ElapsedToString

Previous pageReturn to chapter overviewNext page

 

Description

 

Returns time elapsed since Start event.

 

Syntax

 

n = <cTimer>.ElapsedToString[(Type [, sFormat])]

 

Returns

 

Number: time elapsed since Start event

 

Parameters

 

Name

Type

Optional

Meaning

Type

Number

Yes

One of the following equates:

%cTimer_Seconds

%cTimer_MicroSeconds

%cTimer_MilliSeconds

 

If no type is indicated, the following will be defaulted:

%cTimer_Seconds

 

sFormat

String

Yes

Format characters that will determine how the returned time should be formatted. See Format$ for more info about ormat characters.

 

Remarks

 

This method sets an internal intermediate time. See Intermediate_Count and Intermediate_Get methods.

 

Restrictions

 

See also

 

Examples

 

'---Create a class variable

Dim MyTimer  As cTimer

Dim sOut     As String

 

'---Instantiate the class variable. This will automatically call internal Constructor

MyTimer = New cTimer

...

MyTimer.Start("Hi there, I just started")

...

'---Get elapsed seconds since Start event

sOut = MyTimer.ElapsedToString(%cTimer_Seconds, "#0.00")

...

'---Stop timer

MyTimer.Stop

...