fn run_profile<F, R, G, Args, InArgs: Copy>(name: &str, iterations: usize, 
    setup_args: InArgs, setup: &G, closure: F) 
        where F: FnMut(Args) -> R, G: Fn(InArgs) -> Args {
    let (avg_time,min_time,max_time) = profile_code(iterations, setup_args, 
        setup, closure);
    println!("{:20} {:>15} ns   {:>15} ns   {:>15} ns     {:>10}", 
        name, fmt_val(avg_time), fmt_val(min_time), fmt_val(max_time), 
        iterations);
}
// Run and time a closure and print the results.
// NOTE: This is not quite right, ideally we should run setup code each time
//       to allow parameters to differ.
Run and time a closure and print the results.
NOTE: This is not quite right, ideally we should run setup code each time
to allow parameters to differ.
Run and time a closure and print the results . NOTE : This is not quite right ideally we should run setup code each time to allow parameters to differ .
fn run_profile<F, R, G, Args, InArgs: Copy>(name: &str, iterations: usize, 
    setup_args: InArgs, setup: &G, closure: F) 
        where F: FnMut(Args) -> R, G: Fn(InArgs) -> Args {
    let (avg_time,min_time,max_time) = profile_code(iterations, setup_args, 
        setup, closure);
    println!("{:20} {:>15} ns   {:>15} ns   {:>15} ns     {:>10}", 
        name, fmt_val(avg_time), fmt_val(min_time), fmt_val(max_time), 
        iterations);
}
fn run_profile < F , R , G , Args , InArgs : Copy > ( name : & str , iterations : usize , setup_args : InArgs , setup : & G , closure : F ) where F : FnMut ( Args ) -> R , G : Fn ( InArgs ) -> Args { let ( avg_time , min_time , max_time ) = profile_code ( iterations , setup_args , setup , closure ) ; println ! ( " " name fmt_val ( avg_time ) fmt_val ( min_time ) fmt_val ( max_time ) iterations ) ; }
Run and time a closure and print the results.
Run and time a closure and print the results .
name
&str
iterations
usize
setup_args
InArgs
setup
&G
closure
F
name
&str
iterations
usize
setup_args
InArgs
setup
&G
closure
F