diff --git a/src/main/timesync.c b/src/main/timesync.c index e4bffa1..8d3fd96 100644 --- a/src/main/timesync.c +++ b/src/main/timesync.c @@ -10,7 +10,13 @@ static const char *TAG = "ts"; static bool synchronized = false; void timesyncCallback(struct timeval *tv) { - ESP_LOGI(TAG, "time is synchronized now"); + struct timespec timestamp; + clock_gettime(CLOCK_REALTIME, ×tamp); + uint32_t current_seconds = timestamp.tv_sec; + uint32_t current_milliseconds = timestamp.tv_nsec / 1e6; + + ESP_LOGI(TAG, "time is synchronized now: %u s %u ms", current_secound, current_milliseconds); + synchronized = true; }