Timer - Stop

Declaration

<AMTIMER ACTIVITY="stop" RESULTVARIABLE="text" 
SCALE="text (options)" SESSION="Text" />

Description: Stops a timer session that was previously started using a Start Timer step and populates a variable with the elapsed time.

Practical Usage

Used in conjunction with the Start Timer activity to record the elapsed execution time. A Read Timer activity can be used prior to this step to record the elapsed time without stopping the timer.  

General Parameters

Property

Type

Required

Default

Markup

Description

Populate variable with elapsed time

Text

Yes

(Empty)

RESULTVARIABLE="myVar"

The name of an existing variable to populate with the elapsed time.

Note: Calculation is based on the total amount of time that passed between the start of a previous Start Timer activity and the start of this activity.   

Time Scale

Text (options)

No

Seconds

SCALE="minutes"

The time scale to be used in calculating the elapsed time. The available options are:

  • Seconds (default) - The time will be calculated using seconds.

  • Hours - The time will be calculated using hours.

Session

Text

Yes

TimerSession1

SESSION="TimeSess2"

The name of the session to end.

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: This sample task illustrates execution of the Start Timer, Stop Timer and Read Timer activities.

<AMVARIABLE NAME="timeVar"></AMVARIABLE>
<AMTIMER SESSION="myTime" />
<AMSHOWDIALOG MESSAGE="This step is used 
primarily to increase the elapsed time. Press Ok to proceed." />
<AMTIMER ACTIVITY="read" RESULTVARIABLE="timeVar" SESSION="myTime" />
<AMMESSAGEBOX>The task execution time to this point is %timeVar% seconds.
</AMMESSAGEBOX><AMSTOPTIMER SESSION="myTime" RESULTVARIABLE="timeVar"  />
<AMMESSAGEBOX>The total task execution time is %timeVar% seconds.</AMMESSAGEBOX>