2 # ifndef CPPAD_UTILITY_TIME_TEST_HPP
3 # define CPPAD_UTILITY_TIME_TEST_HPP
141 # include <algorithm>
147 # define CPPAD_EXTRA_RUN_BEFORE_TIMING 0
171 template <
class Test>
174 # if CPPAD_EXTRA_RUN_BEFORE_TIMING
180 while( s1 - s0 < time_min )
181 { repeat = std::max(
size_t(1), 2 * repeat);
186 double time = (s1 - s0) /
double(repeat);
211 template <
class Test>
212 double time_test(Test test,
double time_min,
size_t test_size)
214 # if CPPAD_EXTRA_RUN_BEFORE_TIMING
220 while( s1 - s0 < time_min )
221 { repeat = std::max(
size_t(1), 2 * repeat);
223 test(test_size, repeat);
226 double time = (s1 - s0) /
double(repeat);
232 # undef CPPAD_EXTRA_RUN_BEFORE_TIMING
double time_test(Test test, double time_min)
Preform one wall clock execution timing test.
Define processor symbols and macros that are used by CppAD.
Function that returns the elapsed seconds from first call.
double elapsed_seconds(void)
Returns the elapsed number since the first call to this function.