memo1.Clear; i:=-1; for m:= 0 to 1000000000 do begin application.ProcessMessages; I:= I+1; memo1.Lines.Add(IntToStr(i)); end;