Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: use clock_gettime instead of gettimeofday on Darwin #25633

Open
randall77 opened this issue May 29, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@randall77
Copy link
Contributor

commented May 29, 2018

clock_gettime has higher resolution, we should use it if available.
It is not guaranteed to be available until Darwin 10.12. This issue is on hold until that is our minimum Darwin version.

We could do this now but it would require making the choice at runtime. That seems difficult - we'd need to use the Darwin equivalent of dlopen/dlsym to query the existence of, and call, clock_gettime.

@randall77 randall77 added this to the Go1.12 milestone May 29, 2018

@randall77 randall77 self-assigned this May 29, 2018

@randall77 randall77 modified the milestones: Go1.12, Unplanned Sep 19, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Feb 9, 2019

Change https://golang.org/cl/161721 mentions this issue: unix: add ClockGettime on darwin/amd64

gopherbot pushed a commit to golang/sys that referenced this issue Feb 9, 2019

unix: add ClockGettime on darwin/amd64
Updates golang/go#25633

Change-Id: I20ff2d0cda642fb7b155d3ae06499e8c0ef0a2b2
Reviewed-on: https://go-review.googlesource.com/c/161721
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.