mirror of
https://github.com/esphome/esphome.git
synced 2025-09-25 06:32:22 +01:00
Reduce number of calls to fetch time in the main loop (#8804)
This commit is contained in:
@@ -229,8 +229,11 @@ void HOT Scheduler::call() {
|
||||
// - timeouts/intervals get added, potentially invalidating vector pointers
|
||||
// - timeouts/intervals get cancelled
|
||||
{
|
||||
WarnIfComponentBlockingGuard guard{item->component};
|
||||
uint32_t now_ms = millis();
|
||||
WarnIfComponentBlockingGuard guard{item->component, now_ms};
|
||||
item->callback();
|
||||
// Call finish to ensure blocking time is properly calculated and reported
|
||||
guard.finish();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user