background image
<< How Timers Work | Visual Basic scripts >>
<< How Timers Work | Visual Basic scripts >>

Why Use Timers?

Why Use Timers?
Use timers in the following cases:
To time an overlapping sequence of events. Insert a
followed by several
commands. You cannot overlap blocks,
although you can nest them.
To time a specific portion of the script. Insert the
commands exactly where you want when you edit the script. You
can insert a block, however, only during recording.
In other cases, you may want to use blocks rather than timers. Blocks not only add
timers to a script but also add a prefix to each command ID in the block. This prefix
enables you to easily identify emulation commands associated with a block both in
the script and in the report output. For more information, refer to the section in this
chapter on blocks.
Adding a Timer During Recording
You can add a timer to a script during recording follows:
1. If the Session Insert floating toolbar is not already displayed, click the Display
Session Insert Toolbar button on the Session Record floating toolbar.
2. Click the Start Timer button.
3. In the Start Timer dialog box, type the timer's name (40 characters maximum)
and click OK.
4. Perform the timed activity.
5. Immediately after receiving the results generated by the activity, click the Stop
Timer button on the Session Insert floating toolbar.
6. In the Stop Timer dialog box, select the name of the timer you typed in step 3
and click OK.
When you start and stop a timer during recording, you can view these commands in
the Annotations window.
Adding a Timer During Editing
The Session Insert toolbar adds timers during recording. To add a timer during
editing, type the timer commands into the script.