(b *testing.B, numRoutines int, q Queue, test func(Queue, int))
| 11 | ) |
| 12 | |
| 13 | func runParallelBench(b *testing.B, numRoutines int, q Queue, test func(Queue, int)) { |
| 14 | if useFixedBench { |
| 15 | b.N = benchIterations |
| 16 | } |
| 17 | N := b.N / numRoutines |
| 18 | wg := &sync.WaitGroup{} |
| 19 | for i := 0; i < numRoutines; i += 1 { |
| 20 | wg.Add(1) |
| 21 | go func(){ |
| 22 | test(q, N) |
| 23 | wg.Done() |
| 24 | }() |
| 25 | } |
| 26 | wg.Wait() |
| 27 | } |
| 28 | |
| 29 | func benchANRN(q Queue, N int){ |
| 30 | for i := 0; i < N; i += 1 { |
no test coverage detected