Description

Reads the value of a timer previously started in an established session. The time value is put into an AutoMate variable without stopping the timer. Timer sessions can be used to gauge the execution time between Start Timer and Stop Timer steps. Use this step to read the timer value without stopping the timer.

Practical Usage

Ideal for testing the execution speed of time sensitive tasks. Since this action records the elapsed time without stopping the timer, it is mainly used in the middle of a Start Timer and Stop Timer session to gauge the execution time up to a specific point in the task.

Parameters

General Properties

Property

Type

Required

Default

Markup

Description

Timer Name

Text

Yes

TimerSession1

SESSION="TimeSess2"

The name of the timer session previously established by a Start Timer step that should be read. Timer sessions allow several timers to be running simultaneously. The default value is TimerSession1.

Populate Variable With Elapsed Time

Text

Yes

(Empty)

RESULTVARIABLE="myVar"

The variable to populate with the timer reading.

Time Scale

Text (options)

No

Seconds

SCALE="minutes"

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

  • Hours

  • Minutes (default)

  • Seconds

  • Milliseconds

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

This sample task illustrates usage of the Start Timer, Stop Timer and Read Timer actions.

 

<AMVARIABLE NAME="timeVar"></AMVARIABLE>

<AMSTARTTIMER SESSION="myTime" />

<AMMESSAGEBOX>This step is used mainly to add some time between the Start Timer and Read Timer step.</AMMESSAGEBOX>

<AMREADTIMER SESSION="myTime" RESULTVARIABLE="timeVar" />

<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>

 

↑ Top of Page