Skip to content

Conversation

BrandonLWhite
Copy link
Contributor

This resolves #3814 and adds a micros64() global function that is very useful.

There is certainly more that can be done to improve wallclock time-keeping, but this is a step in the right direction I feel. This allows my application to have a reasonably decent current timestamp.

This now works well enough for me, when it previously was wrong:

auto now_ms = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();

I purposely did not touch clock_gettime() or time() because I want to focus on achieving a functional gettimeofday first. If this PR is accepted, I'm willing to work on those functions too.

@igrr igrr merged commit 5b92569 into esp8266:master Nov 14, 2017
@BrandonLWhite
Copy link
Contributor Author

Thank you! I'm thrilled to have an accepted PR in your project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gettimeofday incorrect value for tv_usec
2 participants