Description
The current implementation _gettimeofday_r is incorrectly setting the tv_usec field.
https://github.com/esp8266/Arduino/blob/master/cores/esp8266/time.c#L104
According to http://www.gnu.org/software/libc/manual/html_node/Elapsed-Time.html
tv_usec should be "This is the rest of the elapsed time (a fraction of a second), represented as the number of microseconds. It is always less than one million."
The current code is simply doing tp->tv_usec = micros();
. This leads to the wall clock time advancing forward too quickly. I am certainly aware of the caveats of tracking wallclock (ie CLOCK_REALTIME) in ESP8266, but this is just making it far worse.
I have some ideas on how to square this away once and for all (crossing my fingers). I will try to follow-up with additional info or possibly a pull request.