Skip to main content

estimate_transfer_time

Function estimate_transfer_time 

Source
pub fn estimate_transfer_time(
    bytes: usize,
    bandwidth_gbps: f64,
    latency_us: f64,
) -> f64
Expand description

Estimates the transfer time in milliseconds for a given data size.

Uses a simple linear model: time = latency + bytes / bandwidth.

§Parameters

  • bytes — number of bytes to transfer.
  • bandwidth_gbps — sustained bandwidth in GB/s.
  • latency_us — fixed per-transfer overhead in microseconds.

§Returns

Estimated transfer time in milliseconds. Returns f64::INFINITY if bandwidth_gbps is zero or negative.