* Returns mean of samples contained in the buffer
()
| 741 | * Returns mean of samples contained in the buffer |
| 742 | */ |
| 743 | average(): number { |
| 744 | if (this.length === 0) return 0; |
| 745 | let sum = 0; |
| 746 | for (let i = 0; i < this.length; i++) { |
| 747 | sum += this.rttSamples[i]; |
| 748 | } |
| 749 | |
| 750 | return sum / this.length; |
| 751 | } |
| 752 | |
| 753 | /** |
| 754 | * Returns most recently inserted element in the buffer |
no outgoing calls
no test coverage detected