-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: time.Sleep() wakes up too early #48214
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
Comments
Does this happen with 1.17? |
I will try it with 1.17 |
@seankhliao It happened with 1.17
|
I wonder if this is a montonic time vs wall clock time issue. Could you do an experiments for me: Change the code to use time.Since rather than computing the difference between two Unix nano values. |
@davecheney I will try again with the following program: |
@davecheney You are right. The problem was how to measure the duration. With time.Since, the output of the program is:
I close this issue |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
N/A
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I ran the following program on my MacBook Pro M1
https://play.golang.org/p/foEoaXu4HHu
What did you expect to see?
No value under 100ms
What did you see instead?
The text was updated successfully, but these errors were encountered: