Timer - Read

Declaration

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

Related Topics   

Description

Calculates the time that elapsed since execution of a prior Timer - Start activity and populates a variable with the result without stopping the timer.

Practical Usage

This activity is primarily used in the middle of a Timer - Start and Timer - Stop step to gauge the execution time up to a specific point in the task. It is ideal for calculating the elapsed time between the start and end of a particular process or operation within a task, in contrast to the actual time needed to perform the task entirely.

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

Description

Error Causes

On Error

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description

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

Copy
<AMVARIABLE NAME="timeVar" />
<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>