-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
testing: b.StopTimer breaks b.Loop #72922
Comments
CC @JunyangShao |
Related Issues
Related Code Changes Related Documentation Related Discussions
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Change https://go.dev/cl/658975 mentions this issue: |
@gopherbot, please backport to Go 1.24. |
Backport issue(s) opened: #72934 (for 1.24). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Go version
go version go1.24.1 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Consider the following benchmark function:
Run with
go test -bench=. -benchtime=1s
b.Loop
never returns false and the benchmark never terminates.In
B.stopOrScaleBLoop
we useb.start
to compute how long we took to iterateb.N
times. However, callingB.StartTimer
setsb.start
to the current time.None of the documentation says that using
b.StopTimer
/b.StartTimer
is forbidden when usingb.Loop
.The text was updated successfully, but these errors were encountered: