rclone/vendor/github.com/djherbis/times/bench_test.go
2017-11-20 12:36:50 +00:00

29 lines
391 B
Go

package times
import (
"os"
"testing"
)
func BenchmarkGet(t *testing.B) {
fileTest(t, func(f *os.File) {
fi, err := os.Stat(f.Name())
if err != nil {
t.Error(err)
}
for i := 0; i < t.N; i++ {
Get(fi)
}
})
t.ReportAllocs()
}
func BenchmarkStat(t *testing.B) {
fileTest(t, func(f *os.File) {
for i := 0; i < t.N; i++ {
Stat(f.Name())
}
})
t.ReportAllocs()
}