graphics: Add BenchmarkGeoM

This commit is contained in:
Hajime Hoshi 2017-05-24 00:56:31 +09:00
parent f05bf143f7
commit 06d3eb66c7

View File

@ -15,8 +15,10 @@
package ebiten_test
import (
. "github.com/hajimehoshi/ebiten"
"math"
"testing"
. "github.com/hajimehoshi/ebiten"
)
func TestGeometryInit(t *testing.T) {
@ -88,3 +90,13 @@ func TestGeometryConcat(t *testing.T) {
}
}
}
func BenchmarkGeoM(b *testing.B) {
var m GeoM
for i := 0; i < b.N; i++ {
m = GeoM{}
m.Translate(10, 20)
m.Scale(2, 3)
m.Rotate(math.Pi / 2)
}
}