Function with Benchmark



    Giovanny Gongora

    Codiga's Rust Recipes

    Use bench to benchmark code inside an iter function

    fn bench_fn_name(b: &mut test::Bencher) {
      b.iter(|| {
        // code to benchmark inside the iter method
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.