MCPcopy Create free account
hub / github.com/bytecodealliance/wstd / debug_duration

Function debug_duration

src/time/mod.rs:117–123  ·  view source on GitHub ↗
(what: &str, f: impl Future<Output = Instant>)

Source from the content-addressed store, hash-verified

115 use super::*;
116
117 async fn debug_duration(what: &str, f: impl Future<Output = Instant>) {
118 let start = Instant::now();
119 let now = f.await;
120 let d = now.duration_since(start);
121 let d: std::time::Duration = d.into();
122 println!("{what} awaited for {} s", d.as_secs_f32());
123 }
124
125 #[test]
126 fn timer_now() {

Callers 2

timer_nowFunction · 0.85

Calls 1

duration_sinceMethod · 0.80

Tested by 2

timer_nowFunction · 0.68