diff --git a/examples/main.go b/examples/main.go index 655becd..0d28879 100644 --- a/examples/main.go +++ b/examples/main.go @@ -49,7 +49,7 @@ func main() { runTimes := 1000 - // Use the common pool + // Use the common pool. var wg sync.WaitGroup for i := 0; i < runTimes; i++ { wg.Add(1) @@ -63,13 +63,13 @@ func main() { fmt.Printf("finish all tasks.\n") // Use the pool with a function, - // set 10 to the size of goroutine pool and 1 second for expired duration + // set 10 to the size of goroutine pool and 1 second for expired duration. p, _ := ants.NewPoolWithFunc(10, func(i interface{}) { myFunc(i) wg.Done() }) defer p.Release() - // Submit tasks one by one + // Submit tasks one by one. for i := 0; i < runTimes; i++ { wg.Add(1) p.Serve(int32(i))