Browse Source

add image resize benchmark

pull/279/head
tnextday 10 years ago
parent
commit
f75514baf9
  1. 21
      go/images/resizing_test.go

21
go/images/resizing_test.go

@ -0,0 +1,21 @@
package images
import (
"testing"
"io/ioutil"
)
func BenchmarkResizing(b *testing.B){
fName := "sample1.jpg"
data, _ := ioutil.ReadFile(fName)
ext := "jpg"
w := 0
h := 355
b.ResetTimer()
for i := 0; i < b.N; i++ {
Resized(ext, data, w, h)
b.SetBytes(int64(len(data)))
}
}
Loading…
Cancel
Save