mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 23:49:44 +08:00
More SNtp debug 11
This commit is contained in:
parent
f5af28c886
commit
28c15b3ff4
11
mongoose.c
11
mongoose.c
@ -4414,7 +4414,9 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
|
||||
}
|
||||
}
|
||||
|
||||
if (poll(fds, n, ms) < 0) {
|
||||
int res = poll(fds, n, ms);
|
||||
MG_DEBUG(("n=%d, ms=%d, errno=%d", n, ms, errno));
|
||||
if (res < 0) {
|
||||
MG_ERROR(("poll failed, errno: %d", MG_SOCK_ERRNO));
|
||||
} else {
|
||||
n = 0;
|
||||
@ -5624,13 +5626,6 @@ uint64_t mg_millis(void) {
|
||||
return xTaskGetTickCount() * portTICK_PERIOD_MS;
|
||||
#elif MG_ARCH == MG_ARCH_AZURERTOS
|
||||
return tx_time_get() * (1000 /* MS per SEC */ / TX_TIMER_TICKS_PER_SECOND);
|
||||
#elif MG_ARCH == MG_ARCH_UNIX && defined(__APPLE__)
|
||||
uint64_t ticks = mach_absolute_time();
|
||||
static mach_timebase_info_data_t timebase;
|
||||
mach_timebase_info(&timebase);
|
||||
double ticks_to_nanos = (double) timebase.numer / timebase.denom;
|
||||
uint64_t uptime_nanos = (uint64_t) (ticks_to_nanos * ticks);
|
||||
return (uint64_t) (uptime_nanos / 1000000);
|
||||
#elif MG_ARCH == MG_ARCH_UNIX
|
||||
struct timespec ts = {0, 0};
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
|
@ -496,7 +496,9 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
|
||||
}
|
||||
}
|
||||
|
||||
if (poll(fds, n, ms) < 0) {
|
||||
int res = poll(fds, n, ms);
|
||||
MG_DEBUG(("n=%d, ms=%d, errno=%d", n, ms, errno));
|
||||
if (res < 0) {
|
||||
MG_ERROR(("poll failed, errno: %d", MG_SOCK_ERRNO));
|
||||
} else {
|
||||
n = 0;
|
||||
|
@ -91,13 +91,6 @@ uint64_t mg_millis(void) {
|
||||
return xTaskGetTickCount() * portTICK_PERIOD_MS;
|
||||
#elif MG_ARCH == MG_ARCH_AZURERTOS
|
||||
return tx_time_get() * (1000 /* MS per SEC */ / TX_TIMER_TICKS_PER_SECOND);
|
||||
#elif MG_ARCH == MG_ARCH_UNIX && defined(__APPLE__)
|
||||
uint64_t ticks = mach_absolute_time();
|
||||
static mach_timebase_info_data_t timebase;
|
||||
mach_timebase_info(&timebase);
|
||||
double ticks_to_nanos = (double) timebase.numer / timebase.denom;
|
||||
uint64_t uptime_nanos = (uint64_t) (ticks_to_nanos * ticks);
|
||||
return (uint64_t) (uptime_nanos / 1000000);
|
||||
#elif MG_ARCH == MG_ARCH_UNIX
|
||||
struct timespec ts = {0, 0};
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
|
Loading…
x
Reference in New Issue
Block a user