MCPcopy Create free account
hub / github.com/evilsocket/cake / print_bench

Function print_bench

cake-core/tests/protocol.rs:369–383  ·  view source on GitHub ↗
(label: &str, size_bytes: usize, duration: Duration, iterations: usize)

Source from the content-addressed store, hash-verified

367}
368
369fn print_bench(label: &str, size_bytes: usize, duration: Duration, iterations: usize) {
370 let total_bytes = size_bytes * iterations;
371 let throughput = total_bytes as f64 / duration.as_secs_f64();
372 let per_op = duration / iterations as u32;
373 println!(
374 " {:<45} {:>8} x {:>5} = {:>10} in {:>8.2}ms ({}/s, {:.1}us/op)",
375 label,
376 human_bytes(size_bytes),
377 iterations,
378 human_bytes(total_bytes),
379 duration.as_secs_f64() * 1000.0,
380 human_bytes(throughput as usize),
381 per_op.as_secs_f64() * 1_000_000.0,
382 );
383}
384
385#[tokio::test]
386#[ignore]

Callers 3

bench_serializationFunction · 0.85
bench_tcp_roundtripFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected