promgleam/utils

Utility functions to perform common tasks which are often needed when dealing with metrics.

Functions

pub fn measure(func: fn() -> a) -> #(Int, a)

Measures the execution time of a function in milliseconds, then returns that with the function return value in a tuple.

Examples

fn my_func() {
  "wibble"
}

let assert #(time_taken, "wibble") = measure(my_func)
Search Document