formatted testing codes

This commit is contained in:
andy pan 2018-07-02 14:56:20 +08:00
parent 360a5be5f7
commit 5c1e3a17bb
1 changed files with 11 additions and 11 deletions

View File

@ -32,14 +32,14 @@ import (
const ( const (
_ = 1 << (10 * iota) _ = 1 << (10 * iota)
KiB // 1024 KiB // 1024
MiB // 1048576 MiB // 1048576
GiB // 1073741824 GiB // 1073741824
TiB // 1099511627776 (超过了int32的范围) TiB // 1099511627776 (超过了int32的范围)
PiB // 1125899906842624 PiB // 1125899906842624
EiB // 1152921504606846976 EiB // 1152921504606846976
ZiB // 1180591620717411303424 (超过了int64的范围) ZiB // 1180591620717411303424 (超过了int64的范围)
YiB // 1208925819614629174706176 YiB // 1208925819614629174706176
) )
const RunTimes = 1000000 const RunTimes = 1000000
const loop = 10 const loop = 10
@ -57,9 +57,9 @@ func demoPoolFunc(args interface{}) error {
// 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) {