mirror of
https://github.com/panjf2000/ants.git
synced 2025-12-17 02:21:04 +00:00
update go test
This commit is contained in:
parent
0423264ffa
commit
315a18400c
14
ants_test.go
14
ants_test.go
@ -4,6 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"github.com/panjf2000/ants"
|
"github.com/panjf2000/ants"
|
||||||
"sync"
|
"sync"
|
||||||
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
var n = 100000
|
var n = 100000
|
||||||
@ -34,9 +35,9 @@ func TestDefaultPool(t *testing.T) {
|
|||||||
|
|
||||||
ants.Wait()
|
ants.Wait()
|
||||||
|
|
||||||
//mem := runtime.MemStats{}
|
mem := runtime.MemStats{}
|
||||||
//runtime.ReadMemStats(&mem)
|
runtime.ReadMemStats(&mem)
|
||||||
//fmt.Println("memory usage:", mem.TotalAlloc/1024)
|
t.Logf("memory usage:%d", mem.TotalAlloc/1024)
|
||||||
}
|
}
|
||||||
|
|
||||||
//func TestCustomPool(t *testing.T) {
|
//func TestCustomPool(t *testing.T) {
|
||||||
@ -63,9 +64,10 @@ func TestNoPool(t *testing.T) {
|
|||||||
demoFunc()
|
demoFunc()
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
//mem := runtime.MemStats{}
|
mem := runtime.MemStats{}
|
||||||
//runtime.ReadMemStats(&mem)
|
runtime.ReadMemStats(&mem)
|
||||||
//fmt.Println("memory usage:", mem.TotalAlloc/1024)
|
t.Logf("memory usage:%d", mem.TotalAlloc/1024)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user