Added quick and dirty _gettimeofday_r() test implementation.

This commit is contained in:
doragasu 2016-03-11 13:11:15 +01:00
parent 16c831fffa
commit 0482aebf7d
2 changed files with 22 additions and 0 deletions

View file

@ -50,6 +50,14 @@ void SntpTsk(void *pvParameters)
sntp_initialize(1, 0);
sntp_set_servers(servers, sizeof(servers) / sizeof(char*));
printf("DONE!\n");
struct timespec ts;
clock_getres(CLOCK_REALTIME, &ts);
printf("Time resolution: %d secs, %d nanosecs\n", t.tv_sec, t.tv_nsec);
clock_gettime(CLOCK_REALTIME, &t);
printf("Time: %d secs, %d nanosecs\n", t.tv_sec, t.tv_nsec);
while(1) {
vTaskDelayMs(5000);
time_t ts = sntp_get_rtc_time(NULL);