IdHTTP AWorkCount Transfer Rate lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Mr.Toxic · 2012-04-22 05:30 Hi , I am kinda newbie , If anyone can help me to calculate the transfer rate i will be glade. I did some research and found this code and it is not working. procedure TDX.IdHTTP1Work(ASender: TObject; AWorkMode: TWorkMode;   AWorkCount: Int64); var S, KB, GT: string; TotalTime: TDateTime; H, M, Sec, MS: Word; DLTime: Double; AverageSpeed: Extended; KiloBytes: Extended; TotalSizes: Extended; begin //Application.ProcessMessages; TotalTime := Now - STime; DecodeTime(TotalTime, H, M, Sec, MS); Sec := Sec + M * 60 + H * 3600; DLTime := Sec + MS / 1000; if DLTime > 0 then begin AverageSpeed := (AverageSpeed + (AWorkCount / 1024) / DLTime ) / 2; //calculate from bytes to kb, counting the bytes here LBSpeed.Caption := FormatFloat('0.00 KB/s', AverageSpeed);   end; end; ---------------------------------------------------------------------- Mr.Toxic · 2012-04-22 23:11 I played with timers i dunno if it is right can someone give his opinion. procedure TDX.IdHTTP1Work(ASender: TObject; AWorkMode: TWorkMode;   AWorkCount: Int64); begin   Application.OnException := AppException;   Application.ProcessMessages;   Progressbar1.Position := AWorkCount;   timer2.Enabled := true;   timer1.Enabled := true;   LBRemainTime.Caption := IntToStr(co);   LBPassTime.Caption := IntToStr(co1); end; procedure TDX.Timer1Timer(Sender: TObject); begin  co := Progressbar1.Position;  LBRemainTime.caption := Inttostr(co); end; procedure TDX.Timer2Timer(Sender: TObject); begin   if idhttp1.Connected then    begin    delay(600);    co1 := ProgressBar1.Position;     lbpasstime.Caption := inttostr(co1);      timer3.Enabled := true; end; end; procedure TDX.Timer3Timer(Sender: TObject); var speed : extended; begin   if co>co1 then     begin     speed := ( co - co1 ) / 1024;     LBSpeed.Caption := formatfloat('0,00 Kb/sec',speed);     end; end;