gf/g/os/gfpool/gfpool_test.go
2018-09-25 13:18:43 +08:00

22 lines
452 B
Go

package gfpool
import (
"testing"
"os"
)
func Benchmark_os_Open_Close(b *testing.B) {
for i := 0; i < b.N; i++ {
f, _ := os.OpenFile("/tmp/bench-test", os.O_RDWR|os.O_CREATE|os.O_TRUNC|os.O_APPEND, 0766)
f.Close()
}
}
func Benchmark_gfpool_Open_Close(b *testing.B) {
for i := 0; i < b.N; i++ {
f, _ := Open("/tmp/bench-test", os.O_RDWR|os.O_CREATE|os.O_TRUNC|os.O_APPEND, 0766)
f.Close()
}
}