Timers in Performance Testing

Timers are used to simulate real user think time and delays between requests. They help in producing realistic load on the server and avoiding unrealistically high throughput.

Why Use Timers?

  • Simulate real user behavior (think time).
  • Prevent overwhelming the server.
  • Produce realistic load and throughput.
  • Help in identifying performance bottlenecks.

When to Use Timers?

  • Between two related requests.
  • After logging in.
  • Before submitting a form.
  • Between page navigation.

How It Works?

Timers introduce a delay (fixed or random) between requests in a script to mimic user pauses.

Types of Timers (Common Across Tools)

Timer Type Description Use Case Example
Constant Timer Adds a fixed delay (in ms) between requests. When user think time is constant. Wait 2000 ms between requests.
Uniform Random Timer Adds a random delay between a minimum and maximum value. When user think time varies in a range. Random wait between 1000 - 5000 ms.
Gaussian Random Timer Adds a random delay with normal (Gaussian) distribution. When most users think time around an average. Average 3000 ms, Deviation 1000 ms.
Synchronizing Timer Forces users to wait until all virtual users reach the timer before continuing. When steps must be synchronized across users. All users wait at a step before checkout.
Throughput Controller (as Timer) Controls the rate (TPS) by adding delays automatically. When you want to achieve target throughput. Maintain 50 transactions per second.

How to Add Timers in Different Tools

1. LoadRunner (VuGen)

1
Open Script
Open your script
in VuGen.
2
Select Location
Right-click on the
step where you want
to add the timer.
3
Insert Timer
Go to
Insert → Timer
4
Choose Timer Type
Select the desired
timer type.
5
Configure
Set the timer
properties.
6
Save and Run
Save the script
and run.

Timers in LoadRunner (VuGen)

Timer Type Path in VuGen Description Key Properties
Think Time (Default) (Built-in Think Time) Automatically inserted between consecutive steps. Think Time = <min> - <max> (in ms)
Constant Timer Insert → Timer → Constant Timer Adds a fixed delay. Duration (in ms)
Random Timer Insert → Timer → Random Timer Adds a random delay between min and max. Duration Min, Duration Max (in ms)
Sync Timer Insert → Timer → Sync Timer Synchronizes all Vusers at that point. Name (to identify sync point), Timeout
Throughput Controller Insert → Timer → Throughput Controller Maintains a target throughput by adding delay. Target TPS, Per Transaction

LoadRunner – Example

Scenario: Add a Random Timer after login request with 1000 - 5000 ms delay.


LoadRunner Example Diagram

1. Right-click after login request → 2. Select Random Timer → 3. Configure Timer → 4. Timer added to script.

Best Practices

  • Use timers to reflect real user think time.
  • Avoid using fixed (constant) timers everywhere.
  • Use random timers to simulate real-world behavior.
  • Place timers at logical points, not at the beginning or end.
  • Validate with business scenarios and monitoring.

Common Mistakes

  • Not using timers (causes unrealistically high load).
  • Using same timer value everywhere.
  • Using excessively high timer values (low throughput).
  • Not synchronizing users when required.
  • Ignoring think time during analysis.