IStartStopTimingTest

IStartStopTimingTest is an abstract framework class for timing measurements too complicated to do with ITimingTest. It is a subclass of ITimingTest with the following:
  1. Lower precision
  2. The ability to start and stop the timer.

It is used when the timer needs to be started and stopped multiple times. Because this results in a loss of precision, use ITimingTest whenever possible.

To use, subclass and override startStopTimingTest much as you would override ITimingTest::timingTest.


IStartStopTimingTest - Member Functions and Data by Group

Constructors & Destructor

Class constructors and destructors.


[view class]
~IStartStopTimingTest
public:
virtual ~IStartStopTimingTest()
Destructs objects of this class.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IStartStopTimingTest


Overload 1
public:
IStartStopTimingTest(const IStartStopTimingTest& other)
Copy constructor that accepts the IStartStopTimingTest to be copied.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
protected:
IStartStopTimingTest( unsigned long timingCount, unsigned long sampleCount )
Constructor that explicitly sets timing count and sample count.
timingCount
Explicit timing count.
sampleCount
Explicit sample count.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
protected:
IStartStopTimingTest()
This is the default constructor.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Assignment Operators

Standard assignment operators.


[view class]
operator =
public:
IStartStopTimingTest& operator =( const IStartStopTimingTest& other )
Standard assignment operator which accepts the IStartStopTimingTest object used in the assignment.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Specialization Methods

Advanced specialized subclass methods to be used only by those users with a good understanding of the Timing Test classes.


[view class]
doUntimedTest
protected:
virtual void doUntimedTest()
Runs the startStopTimingTest without performing the timing. For example, execute only timingSetup, startStopTimingTest, and timingCleanup. Useful to debug the startStopTimingTest without concern for the timing aspects.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
oneEmptySample
protected:
virtual double oneEmptySample()
Runs an empty sample. Useful to determine the amount of time necessary for the overhead of doing the timing.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
oneSample
protected:
virtual double oneSample()
Determines the time it takes to run one sample.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
samplingErrorMicroseconds
protected:
virtual double samplingErrorMicroseconds() const
Returns the sampling error.

For start-stop tests, the sampling error per sample is k alpha, where k is the number of calls to start or stop per call to startStopTimingTest.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Timing Methods

Methods used to start and stop the timing test.


[view class]
emptyStartStopTimingTest
protected:
virtual void emptyStartStopTimingTest( ITimingTestStopwatch& )
This class calls the timer repeatedly to calibrate times and account for the overhead involved in starting or stoppping the timer. If your startStopTimingTest method starts and stops the timer more than once, override emptyStartStopTimingTest. In your version, start and stop the timer as many times as you do in startStopTimingTest. The class will use this method to calibrate times and to account for the overhead involved in starting or stopping the timer.

The ITimingTestStopwatch is the stopwatch object which you should start and stop. In your overridden version, start and stop this object as many times as you do in startStopTimingTest. For example: Start, stop, start, stop. IStartStopTimingTest uses this function to calibrate times and account for the overhead involved in starting or stopping the timer.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
startStopTimingTest
protected:
virtual void startStopTimingTest(ITimingTestStopwatch&) = 0
This method is analogous to ITimingTest::timingTest. Subclasses override this method to do the following:

For example:

    {
      // Setup the test
      timer.start();
      // Do the operation to be timed
      // ...
      // Stop the timer
      timer.stop();
      // Cleanup
    };

If necessary, the timer can be started and stopped more than once, but this should be avoided if at all possible.

The startStopTimingTest method should always assume the timer is stopped on entry into the method, and should always stop the timer before exiting the method.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IStartStopTimingTest - Inherited Member Functions and Data

Inherited Public Functions

ITest
ITimingTest

Inherited Public Data

ITest
ITimingTest

Inherited Protected Functions

ITest
ITimingTest

Inherited Protected Data