Daher Posted July 8, 2013 Share Posted July 8, 2013 Hi I want for example run a procedure around 60 times, or 60000 milliseconds if possible so I thought this would work: begin repeat until 60; // loops end; or begin repeat until 60000; //Ms end; How do I make it repeat as many times as I like it to do ? Quote Link to comment Share on other sites More sharing options...
slacky Posted July 9, 2013 Share Posted July 9, 2013 (edited) A simple timer using a while-loop. var maxt: Integer; begin maxt := getSystemTime + 2000; //2000ms while(getSystemTime < maxt) do begin //Do something... end; end. Timer with repeat: var maxt: Integer; begin maxt := getSystemTime + 2000; //2000 ms repeat //Do something... until (getSystemTime > maxt); end. ------------------- X iterations: //Do X iterations var maxI, I: Integer; begin maxI := 100; //iterations. for I:=0 to maxI do begin //Do something.. end; end. Edited July 11, 2013 by slacky Quote Link to comment Share on other sites More sharing options...