int _gettimeofday_r(struct _reent* unused, struct timeval *tp, void *tzp) { if (tp) { ensureBootTimeIsSet(); tp->tv_sec = s_bootTime + millis() / 1000; tp->tv_usec = micros() * 1000; } return 0; }
int WEAK_ATTR gettimeofday(struct timeval *tp, void *tzp) { if (tp) { ensureBootTimeIsSet(); tp->tv_sec = (s_bootTime + millis()) / 1000; tp->tv_usec = micros() * 1000; } return 0; }