bandwidth precision improvement

This commit is contained in:
marc barbier
2021-07-10 17:49:12 +02:00
parent f100e2d41b
commit 379cfed69a
@@ -13,6 +13,7 @@ import java.nio.file.Paths;
import java.util.Locale; import java.util.Locale;
import downloader.Log; import downloader.Log;
import downloader.Main;
public class HttpHelper { public class HttpHelper {
private HttpHelper() {} private HttpHelper() {}
@@ -126,7 +127,7 @@ public class HttpHelper {
if(elapsed != 0) { if(elapsed != 0) {
long estimatedBandwith = (long) (bytesRead / elapsed); long estimatedBandwith = (long) (bytesRead / elapsed);
//display the estimate //display the estimate
Log.setStaticPrint(formatBandwidth(estimatedBandwith)); Log.setStaticPrint("estimated bandwidth :" + formatBandwidth(estimatedBandwith * Main.threadNb));
start = System.currentTimeMillis(); start = System.currentTimeMillis();
} }
downloadingWriter.write(buffer, 0, bytesRead); downloadingWriter.write(buffer, 0, bytesRead);