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

randall77 opened this issue May 29, 2018 · 2 comments


Copy link

@randall77 randall77 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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Feb 9, 2019

Change mentions this issue: unix: add ClockGettime on darwin/amd64

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

Change-Id: I20ff2d0cda642fb7b155d3ae06499e8c0ef0a2b2
Run-TryBot: Josh Bleecher Snyder <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Brad Fitzpatrick <>

This comment has been minimized.

Copy link
Contributor Author

@randall77 randall77 commented Aug 26, 2019

Go 1.13 requires Darwin 1.11 or newer. Getting closer...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.