Can that be because I have no sleeps in the codeMost probably yes. Most loops while cause a lot of strain on your cpu. (Some infinite loops will cause your computer to freeze completely)
What you could do is to use sleep to adjust movement speed instead of your current system. (I'm not a hundred percent positive on this solution thought)