nyan Posted March 2, 2017 Share Posted March 2, 2017 (edited) what kind of lag are you getting? if it is a spike at certain times/activities then it is probably because you're missing a small sleep somewhere. you said you use lots of if/else if, you maybe have something like if (animating) { if (whatever) { return something; } else { // sleep(250); // if this is missing lag may happen } // } that's my best guess without seeing anything from your end. Edited March 2, 2017 by superuser 1 Quote Link to comment Share on other sites More sharing options...