(goroutines, iterations int, wg *sync.WaitGroup, f func())
| 45 | } |
| 46 | |
| 47 | func runConcurrently(goroutines, iterations int, wg *sync.WaitGroup, f func()) { |
| 48 | wg.Add(goroutines) |
| 49 | for g := 0; g < goroutines; g++ { |
| 50 | go func() { |
| 51 | defer wg.Done() |
| 52 | for i := 0; i < iterations; i++ { |
| 53 | f() |
| 54 | } |
| 55 | }() |
| 56 | } |
| 57 | } |
no test coverage detected