Helper for testing UnitComponent periodic measurements.
More...
#include <M5Utility.hpp>
#include <algorithm>
#include <cstdint>
#include <numeric>
#include <vector>
Go to the source code of this file.
|
| namespace | m5 |
| | Top level namespace of M5stack.
|
| |
Helper for testing UnitComponent periodic measurements.
- Note
- Depends on GoogleTest
◆ collect_periodic_measurements()
template<class U >
| PeriodicMeasurementResult m5::unit::googletest::collect_periodic_measurements |
( |
U * | unit, |
|
|
const uint32_t | times = 8, |
|
|
const uint32_t | timeout_duration = 0, |
|
|
void(* | callback )(U *) = nullptr ) |
Collect periodic measurement data from a unit.
- Template Parameters
-
- Parameters
-
| unit | Unit instance to collect measurements from |
| times | Number of update cycles to collect |
| timeout_duration | Timeout in ms (0 = auto-calculate as interval * (times + 1)) |
| callback | Optional callback invoked after each successful update |
- Returns
- PeriodicMeasurementResult containing collected intervals and statistics