WaitFor Function

Action

Waits for a number of users that call this function. It only synchronizes virtual users on one agent.

Note: The time that a virtual user spends in this synchronization function does not influence the transaction busy time.

Include file

Kernel.bdh

Syntax

WaitFor( in sName    : string,
         in nCount   : number optional,
         in nTimeout : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sName Name of the synchronization point
nCount Number of users to wait for (optional). If this parameter is omitted, the function waits for all simulated users
nTimeout Timeout of wait period in seconds (optional). If this parameter is omitted, the functions does not report a timeout

Example

dcltrans
  transaction TMain
  const
    WAITFOR_TIME_OUT := 10;
  begin
    ...
    // waits for 5 users rendezvousing at this point in the script
    if not WaitFor("Rendezvous", 5, WAITFOR_TIME_OUT) then
      write("time out\n"); halt;
    end;
    ...
  end TMain;

Sample scripts

Trans.bdf