You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func main() {
l := rate.NewLimiter(100, 1)
var runCounts = new(atomic.Int64)
go func() {
for {
go func() {
t := time.Now()
ok := l.AllowN(t, 1)
if ok {
runCounts.Inc()
}
}()
}
}()
<-time.After(time.Second * 5)
fmt.Println(runCounts.Load())
return
}
i expect result is around 501, but actually it may be a very loard number like 12694.
is there any miss understanding?
The text was updated successfully, but these errors were encountered:
For asking questions about learning the language, see one of our forums: https://golang.org/wiki/Questions. We only use this issue tracker for tracking bugs. People in the forums can explain what is happening here.
i write such test code
i expect result is around 501, but actually it may be a very loard number like 12694.
is there any miss understanding?
The text was updated successfully, but these errors were encountered: