Crates.io | aleo-std-timer |
lib.rs | aleo-std-timer |
version | 0.1.2 |
source | src |
created_at | 2021-11-13 08:40:28.924279 |
updated_at | 2022-10-05 22:09:24.384198 |
description | A timer to conveniently time code blocks |
homepage | |
repository | |
max_upload_size | |
id | 481323 |
size | 51,566 |
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
}