### Performing Timing Tests Using ITimingTest

This code shows a simple test that reports how long it takes to add an object to a sequence.

    class ISequenceAddTimingTest : public ITimingTest {
    public:
    					ISequenceAddTimingTest();
    	virtual 				~ISequenceAddTimingTest();

    protected:
    	virtual void 				timingSetup();
    	virtual void 				timingTest();
    	virtual void 				timingCleanup();

    private:
    	IString 			**fObject; // Array of pointers to objects to be added
    	long 			fObjectArraySize; // Number of items in fObject
    	IString 			**fNextObject; // Pointer to next pointer to add
    	ISequence<IString> fSequence; // Deque to add to
    };

    ISequenceAddTimingTest::ISequenceAddTimingTest()
    {
            fObject = NULL;
            fObjectArraySize = 0;
    }

    ISequenceAddTimingTest::~ISequenceAddTimingTest()
    {
            timingCleanup(); // Just in case timingSetup was called without timingCleanup
    }

    void ISequenceAddTimingTest::timingSetup()
    {
            timingCleanup(); // Just in case timingSetup was called without timingCleanup

            fObjectArraySize = timingCount();
            fObject = new IString*[fObjectArraySize];
            for (long i=0; i < fObjectArraySize; i++)
                fObject[i] = new IString;
            fNextObject = &fObject[0];
    }

    void ISequenceAddTimingTest::timingTest()
    {
            fSequence.add(**fNextObject++);
    }

    void ISequenceAddTimingTest::timingCleanup()
    {
            if (fObject != NULL) {
                for (long i=0; i < fObjectArraySize; i++)
                    delete fobject[i];
                delete[] fobject;
                fObject= NULL;
            }
    }

    RunTestImplementationMacro(ISequenceAddTimingTest);