Infinite while loop despite A>B condition?

Hi ant1fact. Thank you for stripped version. I look it and found some strange. If you switch position of delay from start loop all works fine. But why cant say, its looks like bug.