25 lines
318 B
Go
25 lines
318 B
Go
|
package imageutils
|
||
|
|
||
|
import (
|
||
|
"image"
|
||
|
"image/png"
|
||
|
"io"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func BenchmarkConcat(b *testing.B) {
|
||
|
var instance image.Image
|
||
|
pixel := SinglePixel{}
|
||
|
|
||
|
for i := 0; i < b.N; i++ {
|
||
|
instance = Concat(instance, pixel, Right)
|
||
|
}
|
||
|
err := png.Encode(
|
||
|
io.Discard,
|
||
|
instance,
|
||
|
)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|