Compounds | |
struct | bench |
Typedefs | |
typedef bench | bench_t |
Functions | |
void | bench_init (bench_t *b) |
void | bench_start (bench_t *b) |
void | bench_stop (bench_t *b) |
void | bench_report (bench_t *b, const char *msg,...) |
void | bench_empty (bench_t *b) |
get_timer_counter
). The implementation assumes that the free running counter can overflow only once during a benchmark. This imposes a restrictions on the benchmarked operation: they must be fast enough to not exceed 65536 times the update of the free running counter. For example on a 68HC11 @ 8Mhz they should not exceed 32ms.
The benchmark data is recorded in the bench_t
data type. It must be initialized using bench_init
. For example:
bench_t b; bench_init (&b);
Then, the piece of code that must be benchmarked is enclosed by calls to bench_start
and bench_stop
as follows:
bench_start (&b); ... bench_stop (&b); bench_report (&b, "Operation");
The bench_report
function must be called to compute the time and print the result.
|
Benchmark overhead computation.
This function computes the overhead of the benchmark operations
|
|
Initialize the benchmark object.
This function must be called to initialize the benchmark object. It locks the interrupts and computes the benchmark correction that will be applied to the results. The benchmark correction is based on the benchmark operations overhead computed using
|
|
Report benchmark results.
This function computes the time spent between the
|
|
Start the benchmark. This function starts the benchmark operation by recording the precise time at which the measure begins.
Definition at line 117 of file benchs.h. References bench::b_start. |
|
Stop the benchmark. This function finishes the benchmark operation by recording the precise time at which the measure stops.
Definition at line 133 of file benchs.h. References bench::b_stop. |