GetRandomThinkTime Function

Action

Reads the state of randomization for the thinktime periods specified in several functions.

Include file

Kernel.bdh

Syntax

GetRandomThinkTime( out eOption    : numberoptional,
                    out nDeviation : number optional ): boolean;

Return value

  • true if randomization is enabled

  • false otherwise

Parameter Description
eOption

Can be either:

  • OPT_THINKTIME_EXPONENTIAL: For exponential distribution (default).

  • OPT_THINKTIME_UNIFORM: For uniform distribution. You have to specify also the deviation factor (3rd parameter) that has to be a value between 1 and 100%.

nDeviation The deviation factor used if OPT_THINKTIME_UNIFORM is set (in %).

Example

dcltrans
  transaction Tinit
  var
    nDistribution : number;
    nDeviation    : number;
  begin
    write("Random thinking time: ");
    if GetRandomThinkTime(nDistribution, nDeviation) then
      write("true – distribution: ");
      if nDistribution = OPT_THINKTIME_EXPONENTIAL then
        write("exponential");
      else
        write("uniform");
      end;
    else
      write("false");
    end;
    writeln;
  end TInit;