use std::time::{Duration, Instant};
      
      fn main() {
        let start = Instant::now();
        expensive_function();
        let duration = start.elapsed();
        println!("Time elapsed in expensive_function() is: {:?}", duration);
      }
      
      Rust language logo

      Measure time

      Codiga's Rust Recipes

      between two code executions

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.