Changeset 146 for MicroThreading/Demo/UMainForm.pas
- Timestamp:
- Jan 26, 2011, 7:28:29 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MicroThreading/Demo/UMainForm.pas
r145 r146 208 208 Item.SubItems.Add(MicroThreadStateText[State]); 209 209 Item.SubItems.Add(FloatToStr(ExecutionTime)); 210 Item.SubItems.Add(IntToStr(Trunc(Completion * 100)) + '%'); 210 211 end; 211 212 finally … … 226 227 var 227 228 I: Integer; 229 const 230 TotalSteps = 100; 228 231 begin 229 232 with MicroThread do begin 230 233 Memo1.Lines.Add('Worker ' + IntToStr(Id)); 231 for I := 0 to 1000do begin234 for I := 0 to TotalSteps - 1 do begin 232 235 Memo1.Lines.Add(IntToStr(Id) + ': ' + IntToStr(I) + ' ' + 233 236 FloatToStr(ExecutionTime)); 237 Completion := I / TotalSteps; 234 238 //Sleep(1 * Id * OneMillisecond); 235 239 Yield;
Note:
See TracChangeset
for help on using the changeset viewer.