Skip to content

li195111/qctimer_macros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Timer Proc Macros

The Rust macros that used to estimate function call time cost.

Install

  • Clone this repositry

    git clone https://github.com/li195111/qctimer_macros.git

Add to your project's Cargo.toml

  • Go to the project that you want to use qctimer

  • Add dependencies as following

    [dependencies]
    qctimer_macros = { path = "< PATH / TO / qctimer_macros >" }

How to use

use qctimer_macros::timer;

#[timer]
fn function_you_want_estimate(...) {
    ...
}

Async Use

use qctimer_macros::async_timer;

#[async_timer]
async fn async_function_you_want_estimate(...) {
    ...
}

Result in console

It will println following messages.

function_you_want_estimate Time Cost: 3 ms.
another_function_you_want_estimate Time Cost: 637 µs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages