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: start nanotime at runtime start #22436

aclements opened this Issue Oct 25, 2017 · 1 comment


None yet
3 participants

aclements commented Oct 25, 2017

Currently the zero value of runtime.nanotime means different things on different systems. On some, it's system boot time, on others it's program start time. We should make it measure time from program start on all platforms for consistency. Then we can also eliminate runtimeInitTime. (If we do this, we should also make it harder to call nanotime too early in runtime init, either by panicking if the program start time isn't established or by establishing program start time much earlier during init.)

More discussion in #22394.


This comment has been minimized.


rsc commented Oct 25, 2017

Re last bit, initializing startTime explicitly in runtime.schedinit SGTM. At that point the only worry is that osinit might refer to nanotime, but that seems very unlikely.

@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Go1.12 Jul 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment