Skip to content

Commit

Permalink
The time limits are now ignored if the speed is still 0.00 when the l…
Browse files Browse the repository at this point in the history
…imit is reached
  • Loading branch information
adolfintel committed Jul 16, 2017
1 parent 739d92d commit b20c137
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions doc.md
Original file line number Diff line number Diff line change
@@ -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/)

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions speedtest_worker.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion speedtest_worker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b20c137

Please sign in to comment.