Merge branch 'feature/move_gettimeofday_in_clock_gettime_v3.3' into 'release/v3.3'

newlib: Move _gettimeofday_r call in clock_gettime (v3.3)

See merge request espressif/esp-idf!5717
This commit is contained in:
Jiang Jiang Jian 2019-09-08 23:13:13 +08:00
commit 54c7379060

View File

@ -415,10 +415,10 @@ int clock_gettime (clockid_t clock_id, struct timespec *tp)
return -1;
}
struct timeval tv;
_gettimeofday_r(NULL, &tv, NULL);
uint64_t monotonic_time_us = 0;
switch (clock_id) {
case CLOCK_REALTIME:
_gettimeofday_r(NULL, &tv, NULL);
tp->tv_sec = tv.tv_sec;
tp->tv_nsec = tv.tv_usec * 1000L;
break;