@@ -68,6 +68,7 @@ class TestClass
6868 , m_current_time(m_start_time)
6969 , m_timed_function_calls(0 )
7070 , m_sample_time(secs, nanosecs)
71+ , m_stop_time(m_start_time + m_sample_time)
7172 , m_check_count(0 )
7273 , m_failure_check_count(0 )
7374 , m_test_number(0 )
@@ -526,21 +527,18 @@ class TestClass
526527 // / @note This function also refreshes the current time.
527528 bool CheckTime ()
528529 {
529- TestTime stop_time (m_start_time);
530- stop_time += m_sample_time;
531-
532530 m_current_time.Refresh ();
533531
534532 ++m_timed_function_calls;
535533
536- bool complete = m_current_time > stop_time ;
537- if (complete )
534+ bool time_complete = m_current_time > m_stop_time ;
535+ if (time_complete )
538536 {
539537 unsigned long call_time = TestTime::GetCallTimeInNanoseconds ();
540538 m_current_time -= TestTime (call_time * static_cast <unsigned long >(m_timed_function_calls));
541539 }
542540
543- return complete ;
541+ return time_complete ;
544542 }
545543
546544 // / While the current time has not reached the start time + sample time,
@@ -549,14 +547,11 @@ class TestClass
549547 // / @note This function also refreshes the current time.
550548 bool CheckTime (ocl_size_type min_iterations, TestString const & filename, ocl_size_type line_number)
551549 {
552- TestTime stop_time (m_start_time);
553- stop_time += m_sample_time;
554-
555550 m_current_time.Refresh ();
556551
557552 ++m_timed_function_calls;
558553
559- bool time_complete = m_current_time > stop_time ;
554+ bool time_complete = m_current_time > m_stop_time ;
560555
561556 if (time_complete && (m_timed_function_calls < min_iterations))
562557 {
@@ -1044,6 +1039,10 @@ class TestClass
10441039 // The amount of time to run the performance test.
10451040 TestTime m_sample_time;
10461041
1042+ // When this test is timed, record the end time.
1043+ // NOTE: This must be defined after m_start_time and m_sample_time.
1044+ TestTime m_stop_time;
1045+
10471046 // Total checks for this function.
10481047 ocl_size_type m_check_count;
10491048
0 commit comments