-
Junior Member
Regular Contributor
case/switch versus if (key =='z') etc.
In processing keyboard events is it faster to use case/switch programming or if(key=="z"){etc.}. I've noticed a significant difference. Maybe user error or not.
-
Senior Member
OpenGL Lord
There is no way your keyboard event testing code is a performance bottleneck. If your benchmarking says that it is, then either your benchmarks are broken or you're really doing it wrong.
-
Junior Member
Regular Contributor
I agree, I think it was my IDE. Key selections and their sequelae were showing up quickly when processed, but when I went to the case/switch methodology, it was noticeably slower. Sometimes wouldn't show until the program stopped. I restarted everything and farmed it out to a new project, and the behavior went away (but not too soon to delete the post : ))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules