forked from mirror/ants
update -
This commit is contained in:
parent
19e41472a9
commit
86325a5f3e
|
@ -30,7 +30,7 @@ import (
|
||||||
"github.com/panjf2000/ants"
|
"github.com/panjf2000/ants"
|
||||||
)
|
)
|
||||||
|
|
||||||
var n = 100000
|
var n = 10000000
|
||||||
|
|
||||||
//func demoFunc() {
|
//func demoFunc() {
|
||||||
// var n int
|
// var n int
|
||||||
|
@ -110,7 +110,7 @@ func TestAntsPoolWithFunc(t *testing.T) {
|
||||||
t.Logf("running workers number:%d", p.Running())
|
t.Logf("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/1024)
|
t.Logf("memory usage:%d", mem.TotalAlloc/GiB)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNoPool(t *testing.T) {
|
func TestNoPool(t *testing.T) {
|
||||||
|
@ -126,7 +126,7 @@ func TestNoPool(t *testing.T) {
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
mem := runtime.MemStats{}
|
mem := runtime.MemStats{}
|
||||||
runtime.ReadMemStats(&mem)
|
runtime.ReadMemStats(&mem)
|
||||||
t.Logf("memory usage:%d", mem.TotalAlloc/1024)
|
t.Logf("memory usage:%d", mem.TotalAlloc/GiB)
|
||||||
}
|
}
|
||||||
|
|
||||||
//func TestCustomPool(t *testing.T) {
|
//func TestCustomPool(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue