JMeter – Constant Timer

JMeter - Constant Timer

In JMeter script, Constant Timer is used to add a constant delay before processing a sampler. If it is added at Test Plan level then it acts as a global timer and the delay is added for all the samplers before the process. If it is added under a sampler then the parent sampler will wait for the defined time and then start execution.

JMeter - Constant Timer
Figure 01

Refer the above screenshot, the constant timer has a delay of 1000 milliseconds (= 1 second) which will apply to all 5 requests and the execution flow will be like this:

Thread Group -> Transaction Controller -> Constant Timer -> Request 01 -> Constant Timer -> Request 02 -> Constant Timer -> Request 03 -> Constant Timer -> Request 04 -> Constant Timer -> Request 05

How to add ‘Constant Timer’ in JMeter script?

Follow the below steps to add the constant timer in the script:

  1. Select the appropriate element where you want to add the timer
    1. Test Plan
    2. Thread Group
    3. Controller
    4. Sampler
  2. Right-click on the element
  3. Hover the mouse on ‘Add’
  4. Hover the mouse on ‘Timers’
  5. Click ‘Constant Timer’

What are the input fields of ‘Constant Timer’?

JMeter – Constant Timer has the following input fields:

JMeter - Constant Timer
Figure 02
  1. Name: To provide the name of the timer 
  2. Comments: To provide arbitrary comments (if any) 
  3. Thread Delay (in milliseconds): The pause time in milliseconds. Thread(s) will hold the execution of the sampler/request for the defined time and once the delay time is over then the sampler will be executed.

Additional Information:

  • The constant timer is processed before each sampler in the scope in which it is found; if there are several timers in the same scope, all the timers will be processed before each sampler.
  • Timers are only processed in conjunction with a sampler. A timer which is not in the same scope as a sampler will not be processed at all.
  • To apply a timer to a single sampler, add the timer as a child element of the sampler.
  • To apply a timer after a sampler, add the Constant Timer as a child element of the next sampler.
  • Flow Control Action can also be used as a timer which adds a delay between two requests.

Leave a Reply

Your email address will not be published. Required fields are marked *