forked from mirror/ants
🐿 Simplify code.
This commit is contained in:
parent
e736e8fac6
commit
e65a7d49b7
|
@ -42,12 +42,6 @@ func demoFunc() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func demoPoolFunc(args interface{}) {
|
func demoPoolFunc(args interface{}) {
|
||||||
//m := args.(int)
|
|
||||||
//var n int
|
|
||||||
//for i := 0; i < m; i++ {
|
|
||||||
// n += i
|
|
||||||
//}
|
|
||||||
//return nil
|
|
||||||
n := args.(int)
|
n := args.(int)
|
||||||
time.Sleep(time.Duration(n) * time.Millisecond)
|
time.Sleep(time.Duration(n) * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
@ -99,7 +93,6 @@ func BenchmarkAntsPoolWithFunc(b *testing.B) {
|
||||||
p.Serve(benchParam)
|
p.Serve(benchParam)
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
//b.Logf("running goroutines: %d", p.Running())
|
|
||||||
}
|
}
|
||||||
b.StopTimer()
|
b.StopTimer()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue