forked from mirror/ants
Merge branch 'develop'
This commit is contained in:
parent
8c76e9fa87
commit
849d3cf828
|
@ -42,7 +42,7 @@ const (
|
||||||
YiB // 1208925819614629174706176
|
YiB // 1208925819614629174706176
|
||||||
)
|
)
|
||||||
const RunTimes = 1000000
|
const RunTimes = 1000000
|
||||||
const loop = 1000000
|
const loop = 10
|
||||||
|
|
||||||
func demoFunc() error {
|
func demoFunc() error {
|
||||||
n := 10
|
n := 10
|
||||||
|
@ -51,15 +51,15 @@ func demoFunc() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func demoPoolFunc(args interface{}) error {
|
func demoPoolFunc(args interface{}) error {
|
||||||
m := args.(int)
|
//m := args.(int)
|
||||||
var n int
|
//var n int
|
||||||
for i := 0; i < m; i++ {
|
//for i := 0; i < m; i++ {
|
||||||
n += i
|
// n += i
|
||||||
}
|
//}
|
||||||
return nil
|
//return nil
|
||||||
// n := args.(int)
|
n := args.(int)
|
||||||
// time.Sleep(time.Duration(n) * time.Millisecond)
|
time.Sleep(time.Duration(n) * time.Millisecond)
|
||||||
// return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkGoroutineWithFunc(b *testing.B) {
|
func BenchmarkGoroutineWithFunc(b *testing.B) {
|
||||||
|
|
Loading…
Reference in New Issue