goLoad/test.go

26 lines
312 B
Go
Raw Normal View History

2022-03-04 00:19:52 +01:00
package main
import (
"fmt"
"sync"
)
func compute(value int, wg *sync.WaitGroup) {
for i := 0; i < value; i++ {
fmt.Println(i)
}
}
func main() {
wg := sync.WaitGroup{}
fmt.Println("Starting")
for c := 0; c < 1000000; c++ {
wg.Add(1)
go compute(10, &wg)
}
wg.Done()
fmt.Println("Finished")
}