Bugfix for incorrect speed calculation, thanks to Dashiva for spotting it.

This commit is contained in:
kappa1 2009-03-19 19:50:38 +00:00
parent 78b4301147
commit 97c038cd06

View file

@ -767,7 +767,7 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
// update only if a second or more has passed
if (timeLapse >= 1000) {
// get kb/s, nice that bytes/millis is same as kilobytes/seconds
float downloadSpeed = (float) bufferSize / timeLapse;
float downloadSpeed = (float) downloadedAmount / timeLapse;
// round to two decimal places
downloadSpeed = ((int)(downloadSpeed*100))/100f;
// set current speed message