This commit is contained in:
Andy Pan 2018-07-15 23:34:12 +08:00
parent 86cea41d7e
commit 68d55de6f8
2 changed files with 2 additions and 1 deletions

View File

@ -44,7 +44,7 @@ const (
const ( const (
RunTimes = 10000000 RunTimes = 10000000
Param = 100 Param = 100
AntsSize = 10000 AntsSize = 500
) )
func demoFunc() error { func demoFunc() error {

View File

@ -47,6 +47,7 @@ func TestAntsPoolWithFunc(t *testing.T) {
} }
wg.Wait() wg.Wait()
t.Logf("pool with func, running workers number:%d", p.Running())
mem := runtime.MemStats{} mem := runtime.MemStats{}
runtime.ReadMemStats(&mem) runtime.ReadMemStats(&mem)
t.Logf("memory usage:%d", mem.TotalAlloc/GiB) t.Logf("memory usage:%d", mem.TotalAlloc/GiB)