From 685082ae03cb6b41d59f84e5f86709b9a1b1a25d Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 24 Feb 2021 23:21:28 +0100 Subject: [PATCH] duration of time request --- cube/User/Src/wizHelper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cube/User/Src/wizHelper.c b/cube/User/Src/wizHelper.c index 60bf387..cee477e 100644 --- a/cube/User/Src/wizHelper.c +++ b/cube/User/Src/wizHelper.c @@ -143,12 +143,15 @@ uint64_t wizSntpQuery() { if (wizDnsQuery(config->ntpServer, ntpServer)) { SNTP_init(SNTP_SOCK, ntpServer, 0, sntpBuffer); uint16_t cycles = 0; + uint32_t startTime = HAL_GetTick(); while (1) { cycles += 1; datetime curTime; if (1 == SNTP_run(&curTime)) { seconds = curTime.seconds - UNIX_NTP_EPOCH_DIFF; 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; } }