From 02a168974db1d6290c375a7732e7c1810b161472 Mon Sep 17 00:00:00 2001 From: andy pan Date: Fri, 6 Jul 2018 14:40:43 +0800 Subject: [PATCH] add expired time in go test --- ants_benchmark_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ants_benchmark_test.go b/ants_benchmark_test.go index e81dff4..35c83a3 100644 --- a/ants_benchmark_test.go +++ b/ants_benchmark_test.go @@ -78,7 +78,7 @@ func BenchmarkGoroutineWithFunc(b *testing.B) { func BenchmarkAntsPoolWithFunc(b *testing.B) { var wg sync.WaitGroup - p, _ := ants.NewPoolWithFunc(50000, func(i interface{}) error { + p, _ := ants.NewPoolWithFunc(50000, 1,func(i interface{}) error { demoPoolFunc(i) wg.Done() return nil @@ -104,7 +104,7 @@ func BenchmarkGoroutine(b *testing.B) { } func BenchmarkAntsPool(b *testing.B) { - p, _ := ants.NewPoolWithFunc(50000, demoPoolFunc) + p, _ := ants.NewPoolWithFunc(50000, 1, demoPoolFunc) defer p.Release() b.ResetTimer()