use std::time::Instant;

pub fn time_execution<F, T>(name: &str, f: F) -> T
where
    F: FnOnce() -> T,
{
    let start = Instant::now();
    let result = f();
    let duration = start.elapsed();
    println!("[benchmark] {}: {:?}", name, duration);
    result
}
