pub fn duration_to_ms(duration: Duration) -> u64
Expand description

From a std::time::Duration object compute the elapsed microseconds.

Arguments

  • duration - The time that has gone by.

Examples

use std::time;
use std::thread;
use genetic_algorithm_tsp_api::tsp_solver;

let before = time::Instant::now();
thread::sleep(time::Duration::from_millis(10));
println!("Sleeping for 10 ms took {} ms", tsp_solver::duration_to_ms(before.elapsed()));