What part of that code is initialization that you do once and what part is something you do in each iteration of the loop? Or do you do all of that every time?
The input code above is performed every time, assuming a certain flag is true. Rotation is then passed to the entity that is supposed to be rotating. Is that bad?
EDIT: Just to be sure, I changed the code such that it is executed regardless of the flag, and the same problem occurs.