mirror of
https://github.com/esphome/esphome.git
synced 2025-09-04 20:32:21 +01:00
Reduce number of calls to fetch time in the main loop (#8804)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <cstring>
|
||||
#include "ble_uuid.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/application.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace esp32_ble {
|
||||
@@ -143,7 +144,7 @@ void BLEAdvertising::loop() {
|
||||
if (this->raw_advertisements_callbacks_.empty()) {
|
||||
return;
|
||||
}
|
||||
const uint32_t now = millis();
|
||||
const uint32_t now = App.get_loop_component_start_time();
|
||||
if (now - this->last_advertisement_time_ > this->advertising_cycle_time_) {
|
||||
this->stop();
|
||||
this->current_adv_index_ += 1;
|
||||
|
Reference in New Issue
Block a user