소스 검색

The time limits are now ignored if the speed is still 0.00 when the limit is reached

dosse91 9 년 전
부모
커밋
b20c13728f
3개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 3
      doc.md
  2. 3 3
      speedtest_worker.js
  3. 0 0
      speedtest_worker.min.js

+ 3 - 3
doc.md

@@ -1,7 +1,7 @@
 # HTML5 Speedtest
 
 > by Federico Dossena  
-> Version 4.2.7, June 22 2017  
+> Version 4.2.8, July 16 2017  
 > [https://github.com/adolfintel/speedtest/](https://github.com/adolfintel/speedtest/)
 
 
@@ -130,10 +130,10 @@ w.postMessage('start {"param1": "value1", "param2": "value2", ...}')
 ```
 
 #### Test parameters
-* __time_dl__: How long the download test should be in seconds
+* __time_dl__: How long the download test should be in seconds. The test will continue regardless of this limit if the speed is still 0.00 when the limit is reached.
     * Default: `15`
     * Recommended: `>=5`
-* __time_ul__: How long the upload test should be in seconds
+* __time_ul__: How long the upload test should be in seconds. The test will continue regardless of this limit if the speed is still 0.00 when the limit is reached.
     * Default: `15`
     * Recommended: `>=10`
 * __count_ping__: How many pings to perform in the ping test

+ 3 - 3
speedtest_worker.js

@@ -1,5 +1,5 @@
 /*
-	HTML5 Speedtest v4.2.7
+	HTML5 Speedtest v4.2.8
 	by Federico Dossena
 	https://github.com/adolfintel/speedtest/
 	GNU LGPLv3 License
@@ -201,7 +201,7 @@ function dlTest (done) {
     }else{
       var speed = totLoaded / (t / 1000.0)
       dlStatus = ((speed * 8 * settings.overheadCompensationFactor)/1048576).toFixed(2) // speed is multiplied by 8 to go from bytes to bits, overhead compensation is applied, then everything is divided by 1048576 to go to megabits/s
-      if ((t / 1000.0) > settings.time_dl || failed) { // test is over, stop streams and timer
+      if (((t / 1000.0) > settings.time_dl && dlStatus > 0) || failed) { // test is over, stop streams and timer
         if (failed || isNaN(dlStatus)) dlStatus = 'Fail'
         clearRequests()
         clearInterval(interval)
@@ -306,7 +306,7 @@ function ulTest (done) {
     }else{
       var speed = totLoaded / (t / 1000.0)
       ulStatus = ((speed * 8 * settings.overheadCompensationFactor)/1048576).toFixed(2) // speed is multiplied by 8 to go from bytes to bits, overhead compensation is applied, then everything is divided by 1048576 to go to megabits/s
-      if ((t / 1000.0) > settings.time_ul || failed) { // test is over, stop streams and timer
+      if (((t / 1000.0) > settings.time_ul && ulStatus > 0) || failed) { // test is over, stop streams and timer
         if (failed || isNaN(ulStatus)) ulStatus = 'Fail'
         clearRequests()
         clearInterval(interval)

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
speedtest_worker.min.js


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.