mirror of
https://github.com/esphome/esphome.git
synced 2025-09-19 11:42:20 +01:00
Reduce number of calls to fetch time in the main loop (#8804)
This commit is contained in:
@@ -70,7 +70,7 @@ void DebugComponent::loop() {
|
||||
#ifdef USE_SENSOR
|
||||
// calculate loop time - from last call to this one
|
||||
if (this->loop_time_sensor_ != nullptr) {
|
||||
uint32_t now = millis();
|
||||
uint32_t now = App.get_loop_component_start_time();
|
||||
uint32_t loop_time = now - this->last_loop_timetag_;
|
||||
this->max_loop_time_ = std::max(this->max_loop_time_, loop_time);
|
||||
this->last_loop_timetag_ = now;
|
||||
|
Reference in New Issue
Block a user