time_measure 0.1.0

A simple library to measure the execution time of code blocks
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::time::Instant;

/// Starts the timer and returns the current time.
pub fn start_timer() -> Instant {
    Instant::now()
}

/// Stops the timer and prints the elapsed time in nanoseconds.
pub fn end_timer(start: Instant) {
    let duration = start.elapsed();
    println!("Execution time: {} nanoseconds", duration.as_nanos());
}