profile_time

Crates.ioprofile_time
lib.rsprofile_time
version0.1.1
sourcesrc
created_at2022-08-30 16:42:49.081347
updated_at2022-08-30 17:03:30.371911
descriptionProvides 2 simple macros to separate debug code and release code
homepagehttps://github.com/rohankid1/profile_time
repositoryhttps://github.com/rohankid1/profile_time
max_upload_size
id655238
size2,975
(rohankid1)

documentation

README

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 {}; 
    }
}
Commit count: 7

cargo fmt