MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / measure_ok

Function measure_ok

vmm/src/lib.rs:584–592  ·  view source on GitHub ↗

Measures the time of the callback, in case it returns `Ok`.

(f: F)

Source from the content-addressed store, hash-verified

582
583/// Measures the time of the callback, in case it returns `Ok`.
584fn measure_ok<T, E, F>(f: F) -> result::Result<(T, Duration), E>
585where
586 F: FnOnce() -> result::Result<T, E>,
587{
588 let begin = Instant::now();
589 let value = f()?;
590 let duration = begin.elapsed();
591 Ok((value, duration))
592}
593
594#[derive(Clone, Deserialize, Serialize)]
595struct VmMigrationConfig {

Callers 3

vm_receive_stateMethod · 0.85
send_migrationMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected