aleo-std-timer

Crates.ioaleo-std-timer
lib.rsaleo-std-timer
version1.0.3
created_at2021-11-13 08:40:28.924279+00
updated_at2025-09-04 20:47:48.292042+00
descriptionA timer to conveniently time code blocks
homepage
repository
max_upload_size
id481323
size51,729
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