Opkman: Limit the update of the progressbar to 1 second.

git-svn-id: trunk@63720 -
This commit is contained in:
balazs 2020-08-11 17:55:38 +00:00
parent a5841ef7d9
commit 9cdb326ff0

View File

@ -92,6 +92,7 @@ type
FSpeed: Integer;
FStartTime: QWord;
FElapsed: QWord;
FTick: Qword;
FNeedToBreak: Boolean;
FDownloadTo: String;
FUPackageName: String;
@ -295,7 +296,11 @@ begin
FSpeed := Round(FTotPosTmp/FElapsed);
if FSpeed > 0 then
FRemaining := Round((FTotSize - FTotPosTmp)/FSpeed);
Synchronize(@DoOnPackageDownloadProgress);
if FElapsed >= FTick + 1 then
begin
FTick := FElapsed;
Synchronize(@DoOnPackageDownloadProgress);
end;
Sleep(5);
end;
@ -309,7 +314,7 @@ begin
Sleep(50);
FErrMsg := '';
FErrTyp := etNone;
if FDownloadType = dtJSON then //JSON
if FDownloadType = dtJSON then
begin
if not FNeedToBreak then
Synchronize(@DoOnJSONProgress);