Skip to main content

calculate_bandwidth

Function calculate_bandwidth 

Source
pub fn calculate_bandwidth(total_bytes: u64, elapsed_secs: f64) -> f64
Expand description

Calculate bandwidth in bits per second from bytes transferred and elapsed time.

ยงExamples

let bps = calculate_bandwidth(10_000_000, 2.0);
assert_eq!(bps, 40_000_000.0);