Crates.io | cost |
lib.rs | cost |
version | 0.1.1 |
source | src |
created_at | 2022-01-13 00:15:39.825514 |
updated_at | 2022-01-13 00:16:50.520934 |
description | measure the cost of running your functions |
homepage | |
repository | |
max_upload_size | |
id | 513101 |
size | 2,797 |
Measure the cost of running a function.
This library exposes a function which takes a callback and returns the cost of running that function.
let (cost, num) = cost(|| fibonacci(20));
println!("it cost {} instructions to compute {}", cost, num);