mirror of https://github.com/panjf2000/ants.git
📝Update example code
This commit is contained in:
parent
08d01b6b48
commit
6851895376
|
@ -57,7 +57,7 @@ func main() {
|
||||||
}
|
}
|
||||||
for i := 0; i < runTimes; i++ {
|
for i := 0; i < runTimes; i++ {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
ants.Submit(syncCalculateSum)
|
_ = ants.Submit(syncCalculateSum)
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
fmt.Printf("running goroutines: %d\n", ants.Running())
|
fmt.Printf("running goroutines: %d\n", ants.Running())
|
||||||
|
@ -73,7 +73,7 @@ func main() {
|
||||||
// Submit tasks one by one.
|
// Submit tasks one by one.
|
||||||
for i := 0; i < runTimes; i++ {
|
for i := 0; i < runTimes; i++ {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
p.Invoke(int32(i))
|
_ = p.Invoke(int32(i))
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
fmt.Printf("running goroutines: %d\n", p.Running())
|
fmt.Printf("running goroutines: %d\n", p.Running())
|
||||||
|
|
Loading…
Reference in New Issue