mirror of
https://github.com/esphome/esphome.git
synced 2026-09-17 01:58:39 +00:00
Set loop_interval to 0 in ApplicationLoop benchmark to skip sleep
This commit is contained in:
@@ -10,6 +10,9 @@ namespace esphome::benchmarks {
|
||||
// This measures the baseline overhead of the main loop: scheduler,
|
||||
// timing, before/after loop tasks, and yield_with_select_.
|
||||
static void ApplicationLoop_Empty(benchmark::State &state) {
|
||||
// Set loop interval to 0 so yield_with_select_ returns immediately
|
||||
// instead of sleeping. This benchmarks the loop overhead, not the sleep.
|
||||
App.set_loop_interval(0);
|
||||
for (auto _ : state) {
|
||||
App.loop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user