Looking for .Sleep(n) options

sdhebertsdhebert Posts: 6
edited December 2, 2005 1:38PM in ANTS Load
I’m looking at overriding the .Sleep() function in the script to provide some options. To allow entirely new sets of tests, I’d like different sleep options to:

1) Use the actual number passed to Sleep.
2) Create a range of numbers in a normal distribution around the passed numbers. These numbers would be configurable.
3) Use completely random numbers within a configurable range.
4) Ignore all numbers passed and execute the script as quickly as possible.

My questions are:
1) Is this already available in the tool and I'm just missing it?
2) Is there a downside in deriving from Control.VirtualClient to override Sleep()?
3) Can I then force the script generator to reference my VirtualClient-implementation?

Thank you,


  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hello Steve,

    I think that you may be able to add some overrides to virtualclient, although this is something I haven't personally tried. The first issue is that you need to place any external assemblies that you want to reference in an ANTS Load project in the ANTS Load folder before you can reference them.

    The second issue is that you can only have one class inherit from VirtualClient as described here: http://www.red-gate.com/messageboard/vi ... .php?t=542

    You may want to be aware that there already is a random sleep function in ANTS Load called (guess what?) RandomSleep(). RandomSleep accepts two arguments: the minimum number of milliseconds and the maximum number of milliseconds. So RandomSleep(1000,30000) will generate a random pause of between 1 and 30 seconds.
  • Thank you for the info and the link. I checked out RandomSleep, but I'd like to have a common Sleep function where I can use different behavior patterns for the entire test suit without modifying a line of code in the tests.

    Thanks again,
  • btw. This would be a really cool feature enhancement to the core product that could be handled similar to the 'State' button on the load screen. :D
This discussion has been closed.