Slow way to check key state, checks and store them externaly.
(b *testing.B, mgr *KeyManager)
| 293 | |
| 294 | // Slow way to check key state, checks and store them externaly. |
| 295 | func checkKeyConfigSubOptimal(b *testing.B, mgr *KeyManager) { |
| 296 | for i, cd := range keySimpleCfg { |
| 297 | keyResult[i].up = mgr.Get(cd).Up() |
| 298 | keyResult[i].down = mgr.Get(cd).Down() |
| 299 | keyResult[i].justUp = mgr.Get(cd).JustReleased() |
| 300 | keyResult[i].justDown = mgr.Get(cd).JustPressed() |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | // Benchmark sub-optimal state checks on a clean key manager. |
| 305 | func BenchmarkKeyMgr_CleanSubOptimal(b *testing.B) { |
no test coverage detected