Problem with millis() timing

it isn't. Run that if statement in your head when diff is 51. Don't think about what you want it to do, look and see what it actually does.