#profile #release #debug

profile_time

Provides 2 simple macros to separate debug code and release code

1 unstable release

Uses new Rust 2021

0.1.1 Aug 30, 2022
0.1.0 Aug 30, 2022

#777 in Procedural macros

22 downloads per month
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:

  • [debug_time!]
  • [release_time!]

No runtime deps