From 06d3eb66c7036e0a93132a53be48481cb19a06fe Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 24 May 2017 00:56:31 +0900 Subject: [PATCH] graphics: Add BenchmarkGeoM --- geom_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/geom_test.go b/geom_test.go index 984b5a001..fe3d96b3a 100644 --- a/geom_test.go +++ b/geom_test.go @@ -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) + } +}