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

This commit is contained in:
dosse91 2017-07-16 08:22:08 +02:00
parent 739d92d69a
commit b20c13728f
3 changed files with 7 additions and 7 deletions

6
doc.md
View file

@ -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

View file

@ -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)

File diff suppressed because one or more lines are too long