MCPcopy
hub / github.com/EngoEngine/engo / checkKeyConfigOptimal

Function checkKeyConfigOptimal

keys_test.go:240–248  ·  view source on GitHub ↗

Fast way to grab current key state, checks and store them externaly.

(b *testing.B, mgr *KeyManager)

Source from the content-addressed store, hash-verified

238
239// Fast way to grab current key state, checks and store them externaly.
240func checkKeyConfigOptimal(b *testing.B, mgr *KeyManager) {
241 for i, cd := range keySimpleCfg {
242 st := mgr.Get(cd)
243 keyResult[i].up = st.Up()
244 keyResult[i].down = st.Down()
245 keyResult[i].justUp = st.JustReleased()
246 keyResult[i].justDown = st.JustPressed()
247 }
248}
249
250// Benchmark state checks with a clean manager.
251func BenchmarkKeyMgr_CleanState(b *testing.B) {

Callers 4

Calls 5

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

Tested by

no test coverage detected