Skip to main content

traffic

Function traffic 

Source
pub fn traffic() -> Result<Traffic>
Expand description

Download and upload over the next second. Blocks for DEFAULT_WINDOW; a monitor keeps a Sampler.

let t = sys_lib::net::traffic()?;            // blocks 1 s
println!("down {} up {}", t.download, t.upload);
println!("down {}", t.download.bits());

ยงErrors

As Sampler::sample.