Micro-benchmarks that are easy to write and run.
Main docs: Home
Namespaces | |
| namespace | pw |
| The Pigweed namespace. | |
| namespace | pw::perf_test |
| Micro-benchmarks library. | |
Macros | |
| #define | PW_PERF_TEST(name, function, ...) |
| #define | PW_PERF_TEST_SIMPLE(name, function, ...) |
Functions | |
| void | pw::perf_test::RunAllTests (EventHandler &handler) |
| #define PW_PERF_TEST | ( | name, | |
| function, | |||
| ... | |||
| ) |
Defines a performance test.
The Framework will create a State and pass it to the provided function. This function should perform whatever behavior is to be measured in a loop as long as State::KeepRunning() returns true.
Example:
| #define PW_PERF_TEST_SIMPLE | ( | name, | |
| function, | |||
| ... | |||
| ) |
Defines a simple performance test.
This macro is similar to PW_PERF_TEST, except that the provided function does not take a State parameter. As a result, the function should NOT call State::KeepRunning(). Instead, the macro calls the function within its own internal state loop.
Example:
| void pw::perf_test::RunAllTests | ( | EventHandler & | handler | ) |
Runs all registered tests,
This function should be called by main. The tests will use the provided handler to report results.