Ok, your loop that waits 1minute   Ok, You have a loop Please login or register to see this code. The problem is that the "Inside" of your loop takes a little time to execute, let's say 1ms. That means that one loop doesn't take 1min, it takes 1min and 1ms. That means that if you started the loop exactly 22:00:00, after 1000 minutes you have drifted 1000*1ms = 1s. and it is 22:00:01 That may not seem so dangerous? Well, assume that you started the loop at 21:59