Timer - Stop

Declaration

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

Related Topics   

Overview

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

Practical usage

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

Parameters

General

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:
  • milliseconds - The time is in milliseconds.
  • seconds (Default) - The time is in seconds.
  • minutes - The time is in minutes.
  • hours - The time is in hours.
Session Text Yes TimerSession1 SESSION="TimeSess2" The session name previously established by a Timer - Start step to associate with this activity. Timer sessions allow several timer-based operations to run simultaneously within a single task. The default value is TimerSession1.

Description

Error Causes

On Error

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

The following sample task illustrates execution of the Timer - Start, Timer - Stop, and Timer - Read activities:

Copy
<AMVARIABLE NAME="timeVar" VALUE="" />
<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" />
<AMSHOWDIALOG>The task execution time to this point is %timeVar% seconds.</AMSHOWDIALOG>
<AMTIMER ACTIVITY="stop" RESULTVARIABLE="timeVar" SESSION="myTime" />
<AMSHOWDIALOG>The total task execution time is %timeVar% seconds.</AMSHOWDIALOG>