Strange behaviour of function Sleep() used in repeat until in Delphi
I have function which is reaction on button click. When I click on the button it should start repeat and write values form an array and show them in labels on main form. Problem is with function sleep - there is some bug or something, cause when I click on the button it waits quite a long time and then it finaly start the action but very quickly. Let's look at my code. Thx for advices. procedure TForm1.ButtonMereniClick(Sender: TObject); var iterator: Integer; begin iterator := 1; repeat //write some values stored int arrays to labels on form LabelTeplota.Caption:='Teplota: '+FloatToStr