This example shows the functions you need to write to start and stop the timer three times during a timing test.
The StartStopTimingTest member function contains the actions you want to time. Start and stop the timer for each action.
void TSampleStartStopRestartTest::StartStopTimingTest(TTimingTestStopwatch& stopwatch)
{
stopwatch.Start();
for (short i=0; i<1000;i++);
stopwatch.Stop();
stopwatch.Start();
for (i=0; i<1000;i++);
stopwatch.Stop();
stopwatch.Start();
for (i=0; i<1000;i++);
stopwatch.Stop();
}
void TSampleStartStopRestartTest::EmptyStartStopTimingTest(TTimingTestStopwatch& stopwatch)
{
stopwatch.Start();
stopwatch.Stop();
stopwatch.Start();
stopwatch.Stop();
stopwatch.Start();
stopwatch.Stop();
}
Test TSampleStartStopRestartTest ( Pass ) {time 570 +/- 180 us}