#debugging #profile #release

profile_time

Provides 2 simple macros to separate debug code and release code

1 unstable release

0.1.1 Aug 30, 2022
0.1.0 Aug 30, 2022

#41 in #release


Used in mkml

MIT license

3KB

profile_time

This crates provides 2 macros to help you separate debug and release code.

Usage

#[macro_use]
extern crate profile_time;

release_time! {
    struct Release {}
}

fn print_profile() {
    release_time! {
        println!("On release");
    }

    debug_time! {
        println!("On debug");
    }
}

debug_time! {
    struct Debug {}
}

fn main() {
    release_time! {
        let profile = Release {};
    }

    print_profile();

    debug_time! {
        let profile = Debug {}; 
    }
}

lib.rs:

profile_time

This lightweight and simples crate provides 2 macros to help you separate debug and release code. This crate provides:

No runtime deps