(b *testing.B)
| 467 | } |
| 468 | |
| 469 | func BenchmarkIdiomaticDouble(b *testing.B) { |
| 470 | preload := func() {} |
| 471 | setup := func(w *World) { |
| 472 | sys12 := &MySystemOneTwo{} |
| 473 | w.AddSystem(sys12) |
| 474 | |
| 475 | e12 := MyEntity12{} |
| 476 | e12.BasicEntity = NewBasic() |
| 477 | |
| 478 | sys12.Add(&e12.BasicEntity, &e12.MyComponent1, &e12.MyComponent2) |
| 479 | } |
| 480 | |
| 481 | Bench(b, preload, setup) |
| 482 | } |
| 483 | |
| 484 | // Bench is a helper-function to easily benchmark one frame, given a preload / setup function |
| 485 | func Bench(b *testing.B, preload func(), setup func(w *World)) { |