Changeset 147 for MicroThreading/Demo/UMainForm.pas
- Timestamp:
- Jan 26, 2011, 8:06:25 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MicroThreading/Demo/UMainForm.pas
r146 r147 28 28 Label1: TLabel; 29 29 Label2: TLabel; 30 Label3: TLabel; 31 Label4: TLabel; 30 32 ListView1: TListView; 31 33 Memo1: TMemo; 32 34 SpinEdit1: TSpinEdit; 35 SpinEdit2: TSpinEdit; 33 36 Timer1: TTimer; 34 37 procedure Button1Click(Sender: TObject); … … 89 92 Button1.Caption := 'Stop scheduler'; 90 93 Memo1.Clear; 94 Scheduler.ThreadPoolSize := SpinEdit2.Value; 91 95 Scheduler.Start; 92 96 end else begin 93 97 Button1.Caption := 'Start scheduler'; 94 98 Scheduler.Stop; 99 Scheduler.ThreadPoolSize := 0; 95 100 end; 96 101 end; … … 227 232 var 228 233 I: Integer; 234 Q: Integer; 229 235 const 230 236 TotalSteps = 100; … … 233 239 Memo1.Lines.Add('Worker ' + IntToStr(Id)); 234 240 for I := 0 to TotalSteps - 1 do begin 235 Memo1.Lines.Add(IntToStr(Id) + ': ' + IntToStr(I) + ' ' + 236 FloatToStr(ExecutionTime)); 241 Q := 0; 242 while Q < 1000000 do Inc(Q); 243 //Memo1.Lines.Add(IntToStr(Id) + ': ' + IntToStr(I) + ' ' + 244 // FloatToStr(ExecutionTime)); 237 245 Completion := I / TotalSteps; 238 246 //Sleep(1 * Id * OneMillisecond);
Note:
See TracChangeset
for help on using the changeset viewer.