#running #measure #function #expose #callback

cost

measure the cost of running your functions

2 releases

0.1.1 Jan 13, 2022
0.1.0 Jan 13, 2022

#1379 in Development tools

MIT license

3KB
54 lines

Cost

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);

No runtime deps

~0–280KB