MercuryTimer Object

An internal timer object that measures the passage of time in milliseconds.

IMPORTANT

The MercuryTimer object is an internal timer item of the MercuryTimers collection object.

Methods and Properties

Method ContinueContinues running the timer from the time it stopped (without resetting it).
Method ResetReturns the elapsed time in milliseconds and resets the timer to zero.
StartStarts the timer.
StopStops the timer, if it is running, and returns the elapsed time in milliseconds.
ElapsedTimeReturns the total accumulated time in milliseconds since the timer started.

Back to top

Continue Method

Description

Continues running the timer from the time it stopped (without resetting it).

If the timer is already running, the Continue method does not affect it.

Syntax

MercuryTimers.Timer(TimerName).Continue

or

MercuryTimers(TimerName).Continue

Note: You can omit the Timer property in the syntax, because Timer is the default property for the MercuryTimers collection object.

IMPORTANT

If the timer is already running, the Continue method does not affect it.

Back to top

Reset Method

Description

Returns the elapsed time in milliseconds and resets the timer to zero.

If the timer is already running, the Reset method stops it before resetting the time to zero.

Syntax

retTime=MercuryTimers.Timer(TimerName).Reset

or

retTime=MercuryTimers(TimerName).Reset

Note: You can omit the Timer property in the syntax, because Timer is the default property for the MercuryTimers collection object.

Return Value

A Number. The elapsed time in milliseconds.

IMPORTANT

If the timer is already running, the Reset method stops it before resetting the time to zero.

Back to top

Start Method

Description

Starts the timer. If the timer is already running, resets the timer and starts counting from zero.

Syntax

MercuryTimers.Timer(TimerName).Start

or

MercuryTimers(TimerName).Start

Note: You can omit the Timer property in the syntax, because Timer is the default property for the MercuryTimers collection object.

Back to top

Stop Method

Description

Stops the timer, if it is running, and returns the elapsed time in milliseconds.

Syntax

MercuryTimers.Timer(TimerName).Stop

or

MercuryTimers(TimerName).Stop

Note: You can omit the Timer property in the syntax, because Timer is the default property for the MercuryTimers collection object.

Return Value

A Number. The total time in milliseconds since the timer started.

IMPORTANT

If the timer is already stopped, the Stop method returns the time in milliseconds.

You can use the Continue method to restart the timer and continue counting from where the timer stopped. (This does not reset the timer.)

Back to top

ElapsedTime Property

Description

Returns the total accumulated time in milliseconds since the timer started.

Syntax

retTime = MercuryTimers.Timer(TimerName).ElapsedTime

or

retTime = MercuryTimers(TimerName).ElapsedTime

or

retTime = MercuryTimers.Timer(TimerName)

or

retTime = MercuryTimers(TimerName)

Note: You can omit the Timer property and/or ElapsedTime property in the syntax, because Timer is the default property for the MercuryTimers collection object, and ElapsedTime is the default property of the MercuryTimer object.

Return Value

A Number. The total accumulated time in milliseconds since the timer started.

IMPORTANT

The ElapsedTime property is the default property for the MercuryTimer object.

Back to top

See also: