Skip to content

Commit

Permalink
Use math/rand/v2 in benchmarks, too
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Aug 21, 2024
1 parent 9d7d7e2 commit 219cc46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bench_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package taskgroup_test

import (
"math/rand"
"math/rand/v2"
"sync"
"testing"
)
Expand All @@ -28,7 +28,7 @@ func BenchmarkChan(b *testing.B) {
for i := 0; i < b.N; i++ {
go func() {
defer wg.Done()
ch <- rand.Intn(1000)
ch <- rand.IntN(1000)
}()
}
wg.Wait()
Expand All @@ -51,7 +51,7 @@ func BenchmarkLock(b *testing.B) {
for i := 0; i < b.N; i++ {
go func() {
defer wg.Done()
report(rand.Intn(1000))
report(rand.IntN(1000))
}()
}
wg.Wait()
Expand Down

0 comments on commit 219cc46

Please sign in to comment.