aleo-std-timer

Crates.ioaleo-std-timer
lib.rsaleo-std-timer
version0.1.2
sourcesrc
created_at2021-11-13 08:40:28.924279
updated_at2022-10-05 22:09:24.384198
descriptionA timer to conveniently time code blocks
homepage
repository
max_upload_size
id481323
size51,566
Howard Wu (howardwu)

documentation

README

aleo-std-timer

Crates.io Authors License

This crate implements a straightforward timer to conveniently time code blocks.

use aleo_std::prelude::*;

fn foo() -> u32{
    // Start the timer.
    let timer = timer!("Arithmetic");

    // Insert expensive operation
    let x = 1 + 1;

    // Print the elapsed time up to this point.
    lap!(timer);

    // Insert expensive operation
    let y = 1 + 1;

    // Print the total time elapsed.
    finish!(timer);

    x + y
}
Commit count: 0

cargo fmt