duration of time request
This commit is contained in:
@ -143,12 +143,15 @@ uint64_t wizSntpQuery() {
|
|||||||
if (wizDnsQuery(config->ntpServer, ntpServer)) {
|
if (wizDnsQuery(config->ntpServer, ntpServer)) {
|
||||||
SNTP_init(SNTP_SOCK, ntpServer, 0, sntpBuffer);
|
SNTP_init(SNTP_SOCK, ntpServer, 0, sntpBuffer);
|
||||||
uint16_t cycles = 0;
|
uint16_t cycles = 0;
|
||||||
|
uint32_t startTime = HAL_GetTick();
|
||||||
while (1) {
|
while (1) {
|
||||||
cycles += 1;
|
cycles += 1;
|
||||||
datetime curTime;
|
datetime curTime;
|
||||||
if (1 == SNTP_run(&curTime)) {
|
if (1 == SNTP_run(&curTime)) {
|
||||||
seconds = curTime.seconds - UNIX_NTP_EPOCH_DIFF;
|
seconds = curTime.seconds - UNIX_NTP_EPOCH_DIFF;
|
||||||
coloredMsg(LOG_BLUE, "wizsq, cycles: %u, curTime: %lu", cycles, seconds);
|
coloredMsg(LOG_BLUE, "wizsq, cycles: %u, curTime: %lu", cycles, seconds);
|
||||||
|
uint32_t stopTime = HAL_GetTick();
|
||||||
|
coloredMsg(LOG_BLUE, "wizsq, duration: %u ms", stopTime - startTime);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user