From 849d3cf8282bc4f91ac74d9b8ca6e45c58343b5a Mon Sep 17 00:00:00 2001 From: andy pan Date: Fri, 15 Jun 2018 11:37:15 +0800 Subject: [PATCH] Merge branch 'develop' --- ants_benchmark_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ants_benchmark_test.go b/ants_benchmark_test.go index 003cd6b..3668e0d 100644 --- a/ants_benchmark_test.go +++ b/ants_benchmark_test.go @@ -42,7 +42,7 @@ const ( YiB // 1208925819614629174706176 ) const RunTimes = 1000000 -const loop = 1000000 +const loop = 10 func demoFunc() error { n := 10 @@ -51,15 +51,15 @@ func demoFunc() error { } func demoPoolFunc(args interface{}) error { - m := args.(int) - var n int - for i := 0; i < m; i++ { - n += i - } - return nil - // n := args.(int) - // time.Sleep(time.Duration(n) * time.Millisecond) - // return nil + //m := args.(int) + //var n int + //for i := 0; i < m; i++ { + // n += i + //} + //return nil + n := args.(int) + time.Sleep(time.Duration(n) * time.Millisecond) + return nil } func BenchmarkGoroutineWithFunc(b *testing.B) {