Browse Source

Improved auto test duration formula

dosse91 5 years ago
parent
commit
e36de9a6ce
1 changed files with 4 additions and 4 deletions
  1. 4 4
      speedtest_worker.js

+ 4 - 4
speedtest_worker.js

@@ -403,8 +403,8 @@ function dlTest(done) {
 				var speed = totLoaded / (t / 1000.0);
 				if (settings.time_auto) {
 					//decide how much to shorten the test. Every 200ms, the test is shortened by the bonusT calculated here
-					var bonus = (6.4 * speed) / 100000;
-					bonusT += bonus > 800 ? 800 : bonus;
+					var bonus = (5.0 * speed) / 100000;
+					bonusT += bonus > 400 ? 400 : bonus;
 				}
 				//update status
 				dlStatus = ((speed * 8 * settings.overheadCompensationFactor) / (settings.useMebibits ? 1048576 : 1000000)).toFixed(2); // speed is multiplied by 8 to go from bytes to bits, overhead compensation is applied, then everything is divided by 1048576 or 1000000 to go to megabits/mebibits
@@ -551,8 +551,8 @@ function ulTest(done) {
 					var speed = totLoaded / (t / 1000.0);
 					if (settings.time_auto) {
 						//decide how much to shorten the test. Every 200ms, the test is shortened by the bonusT calculated here
-						var bonus = (6.4 * speed) / 100000;
-						bonusT += bonus > 800 ? 800 : bonus;
+						var bonus = (5.0 * speed) / 100000;
+						bonusT += bonus > 400 ? 400 : bonus;
 					}
 					//update status
 					ulStatus = ((speed * 8 * settings.overheadCompensationFactor) / (settings.useMebibits ? 1048576 : 1000000)).toFixed(2); // speed is multiplied by 8 to go from bytes to bits, overhead compensation is applied, then everything is divided by 1048576 or 1000000 to go to megabits/mebibits