Example:
// Get immediate bandwidth estimate
auto bw1 = connectionBandwidth();
// Sample over 2 seconds for more accurate measurement
auto bw2 = connectionBandwidth(2.seconds);Gets bandwidth information for all active network connections.
This function samples network connections over the specified window to calculate bandwidth metrics for each connection. It maintains internal state between calls to track connection history.
window | The sampling duration. Use Duration.zero for immediate snapshot, or specify a duration to wait and measure. |
Example:
// Get immediate bandwidth estimate
auto bw1 = connectionBandwidth();
// Sample over 2 seconds for more accurate measurement
auto bw2 = connectionBandwidth(2.seconds);