Expand description
Shared bandwidth measurement loop for download/upload tests.
Eliminates duplication between download.rs and upload.rs by providing
a unified state for:
- Throttled speed sampling (20 Hz max)
- Peak speed tracking
- Progress bar updates
- Atomic byte counting
Each I/O operation (download chunk, upload round) calls record_bytes()
to update shared state. Call finish() at the end to compute final results.
Structsยง
- Bandwidth
Loop State - Shared state for a bandwidth test (download or upload).
- Bandwidth
Result - Final result from a bandwidth test.