基于例程中SNTP接口实现获取网络时间戳后,发现精度只能到秒级,SNTP是否有获取毫秒级时间的办法呢?
// update 'now' variable with current
time
time(&now);
// Set timezone to China Standard Time
setenv("TZ", "CST-8", 1);
tzset();
localtime_r(&now, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
ESP_LOGI(TAG, "The current date/time in Shanghai is: %s", strftime_buf);
ESP_LOGI(TAG, "timestamp = %ld", now);