Prev | Next |
# include <cppad/utility/time_test.hpp>
time = time_test(test, time_min)
time = time_test(test, time_min, test_size)
time = time_test(test, time_min, test_size, repeat_out)
time_test
function executes a timing test
and reports the amount of wall clock time for execution.
time_test
automatically determines how many times to
repeat the section of the test that we wish to time.
cppad/utility/time_test.hpp
defines the
time_test
function.
This file is included by cppad/cppad.hpp
and it can also be included separately with out the rest of
the CppAD
routines.
time_test
argument
test
is a function,
or function object.
In the case where
test_size
is not present,
test
supports the syntax
test(repeat)
In the case where
test_size
is present,
test
supports the syntax
test(size, repeat)
In either case, the return value for
test
is void
.
size
is present,
it has prototype
size_t size
and is equal to the
test_size
argument to time_test
.
test
argument
repeat
has prototype
size_t repeat
It specifies the number of times to repeat the test.
time_min
has prototype
double time_min
It specifies the minimum amount of time in seconds
that the
test
routine should take.
The
repeat
argument to
test
is increased
until this amount of execution time (or more) is reached.
size_t test_size
In this case
test_size
will be present, and have the same value,
in each call to
test
.
size_t& repeat_out
This input value of this argument does not matter.
Upon return, it is the value of repeat
that corresponds to the return value
time
; i.e.,
the actual total time of the test is
total_time = repeat * time
time
has prototype
double time
and is the number of wall clock seconds that it took
to execute
test
divided by the value used for
repeat
.
time_test
.