[online_image] Log download duration in milliseconds instead of seconds (#14803)

This commit is contained in:
leccelecce
2026-03-14 13:15:54 +00:00
committed by Jesse Hills
parent a064eceb9b
commit 98d9871620
2 changed files with 4 additions and 4 deletions

View File

@@ -129,7 +129,7 @@ void OnlineImage::update() {
}
ESP_LOGI(TAG, "Downloading image (Size: %zu)", total_size);
this->start_time_ = ::time(nullptr);
this->start_time_ = millis();
this->enable_loop();
}
@@ -155,8 +155,8 @@ void OnlineImage::loop() {
// Finalize decoding
this->end_decode();
ESP_LOGD(TAG, "Image fully downloaded, %zu bytes in %" PRIu32 "s", this->downloader_->get_bytes_read(),
(uint32_t) (::time(nullptr) - this->start_time_));
ESP_LOGD(TAG, "Image fully downloaded, %zu bytes in %" PRIu32 " ms", this->downloader_->get_bytes_read(),
millis() - this->start_time_);
// Save caching headers
this->etag_ = this->downloader_->get_response_header(ETAG_HEADER_NAME);

View File

@@ -97,7 +97,7 @@ class OnlineImage : public PollingComponent,
*/
std::string last_modified_ = "";
time_t start_time_;
uint32_t start_time_{0};
};
template<typename... Ts> class OnlineImageSetUrlAction : public Action<Ts...> {