()
| 119 | } |
| 120 | |
| 121 | getBytesPerSecond(): number { |
| 122 | if (this.times.length < 2) return 0; |
| 123 | const deltaMs = this.times[this.times.length - 1] - this.times[0]; |
| 124 | if (deltaMs === 0) return 0; |
| 125 | const totalBytes = this.bytes.reduce((sum, b) => sum + b, 0); |
| 126 | return (totalBytes / deltaMs) * 1000; |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | async function main(): Promise<void> { |