mirror of https://github.com/panjf2000/ants.git
add expired time in go test
This commit is contained in:
parent
337c644550
commit
02a168974d
|
@ -78,7 +78,7 @@ func BenchmarkGoroutineWithFunc(b *testing.B) {
|
||||||
|
|
||||||
func BenchmarkAntsPoolWithFunc(b *testing.B) {
|
func BenchmarkAntsPoolWithFunc(b *testing.B) {
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
p, _ := ants.NewPoolWithFunc(50000, func(i interface{}) error {
|
p, _ := ants.NewPoolWithFunc(50000, 1,func(i interface{}) error {
|
||||||
demoPoolFunc(i)
|
demoPoolFunc(i)
|
||||||
wg.Done()
|
wg.Done()
|
||||||
return nil
|
return nil
|
||||||
|
@ -104,7 +104,7 @@ func BenchmarkGoroutine(b *testing.B) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkAntsPool(b *testing.B) {
|
func BenchmarkAntsPool(b *testing.B) {
|
||||||
p, _ := ants.NewPoolWithFunc(50000, demoPoolFunc)
|
p, _ := ants.NewPoolWithFunc(50000, 1, demoPoolFunc)
|
||||||
defer p.Release()
|
defer p.Release()
|
||||||
|
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
|
|
Loading…
Reference in New Issue