i would imagine its coming down to what the compiler is doing, what i did on an arduino (its all c) was to have the button in an interrupt, that updated a variable, had an if statement checking that the variable was not 0, and then doing what ever your buttons needed to do, be it adding the button variable to some other, this was i lost only a few 10's of cycles checking the statement, and my loop kept on flying around like normal otherwise,