MCPcopy Index your code
hub / github.com/EngoEngine/engo / checkKeyConfigSubOptimal

Function checkKeyConfigSubOptimal

keys_test.go:295–302  ·  view source on GitHub ↗

Slow way to check key state, checks and store them externaly.

(b *testing.B, mgr *KeyManager)

Source from the content-addressed store, hash-verified

293
294// Slow way to check key state, checks and store them externaly.
295func 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.
305func BenchmarkKeyMgr_CleanSubOptimal(b *testing.B) {

Calls 5

GetMethod · 0.80
UpMethod · 0.45
DownMethod · 0.45
JustReleasedMethod · 0.45
JustPressedMethod · 0.45

Tested by

no test coverage detected