3 ms·
Using the `async fn` syntax, this whole wrapper becomes: async fn time_future<Fut: Future>(fut: Fut) -> (Fut::Output, Duration) { let start = Insta
by remram 5y ago
Using the `async fn` syntax, this whole wrapper becomes:
async fn time_future<Fut: Future>(fut: Fut) -> (Fut::Output, Duration) {
let start = Instant::now();
let result = fut.await;
(result, start.elapsed())
}
- adamch 5y agoYes, this is just a simplification of the real problem I was solving: docs.rs/restartables