Benchmarking a specific target using criterion

Hi,
I am benchmarking different functions and running as follows:

use criterion::{criterion_group, criterion_main, Criterion};

fn benchmark_function_1(c: &mut Criterion) {
    let mut data = [0u8; 64];
    rand::thread_rng().fill_bytes(&mut data);
    let input: Vec<u8> = data.to_vec();
    // Benchmark logic for function 1
}

fn benchmark_function_2(c: &mut Criterion) {
    // Benchmark logic for function 2
}

criterion_group!(
    name = benches;

    // Setting the sample size to 10 for quick benchmarks
    // Becuase running default number of samples(100) takes a lot of time
    config = Criterion::default().sample_size(10); 
    targets = benchmark_function_1, benchmark_function_2
);

criterion_main!(benches);

My question is, if i want to run only benchmark benchmark_function_1 then how can i do so using CLI arguments??
Also, how can i run the benchmarks based on parameters specified in environment variables. I want to pass those using CLI arguments.

Thank You

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.