forked from mirror/ants
update
This commit is contained in:
parent
e25a58c9f3
commit
b1e6e05756
38
ants_test.go
38
ants_test.go
|
@ -131,41 +131,3 @@ func TestCodeCov(t *testing.T) {
|
||||||
p.ReSize(AntsSize)
|
p.ReSize(AntsSize)
|
||||||
t.Logf("pool with func, after resize, capacity:%d, running:%d", p.Cap(), p.Running())
|
t.Logf("pool with func, after resize, capacity:%d, running:%d", p.Cap(), p.Running())
|
||||||
}
|
}
|
||||||
|
|
||||||
// func TestNoPool(t *testing.T) {
|
|
||||||
// var wg sync.WaitGroup
|
|
||||||
// for i := 0; i < n; i++ {
|
|
||||||
// wg.Add(1)
|
|
||||||
// go func() {
|
|
||||||
// demoPoolFunc(n)
|
|
||||||
// wg.Done()
|
|
||||||
// }()
|
|
||||||
// }
|
|
||||||
|
|
||||||
// wg.Wait()
|
|
||||||
// mem := runtime.MemStats{}
|
|
||||||
// runtime.ReadMemStats(&mem)
|
|
||||||
// t.Logf("memory usage:%d", mem.TotalAlloc/GiB)
|
|
||||||
// }
|
|
||||||
|
|
||||||
//func TestCustomPool(t *testing.T) {
|
|
||||||
// p, _ := ants.NewPool(30000)
|
|
||||||
// var wg sync.WaitGroup
|
|
||||||
// for i := 0; i < n; i++ {
|
|
||||||
// wg.Add(1)
|
|
||||||
// p.Submit(func() {
|
|
||||||
// demoFunc()
|
|
||||||
// //demoFunc()
|
|
||||||
// wg.Done()
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// wg.Wait()
|
|
||||||
//
|
|
||||||
// //t.Logf("pool capacity:%d", p.Cap())
|
|
||||||
// //t.Logf("free workers number:%d", p.Free())
|
|
||||||
//
|
|
||||||
// t.Logf("running workers number:%d", p.Running())
|
|
||||||
// mem := runtime.MemStats{}
|
|
||||||
// runtime.ReadMemStats(&mem)
|
|
||||||
// t.Logf("memory usage:%d", mem.TotalAlloc/1024)
|
|
||||||
//}
|
|
||||||
|
|
Loading…
Reference in New Issue