forked from mirror/ants
update -
This commit is contained in:
parent
d44bf06db0
commit
d9363d36ec
|
@ -41,8 +41,8 @@ const (
|
|||
ZiB // 1180591620717411303424 (超过了int64的范围)
|
||||
YiB // 1208925819614629174706176
|
||||
)
|
||||
const RunTimes = 10000000
|
||||
const loop = 10
|
||||
const RunTimes = 1000000
|
||||
const loop = 1000000
|
||||
|
||||
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)
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue