enum BenchmarkSource
case Benchmark({ f = Unit -> Unit \ IO, name = String })

A benchmark has a name and a function to execute. The function is always impure since timing is considered a side-effect in this context.


def defBenchmark(name: String, f: Unit -> a \ ef): Benchmark Source

A smart constructor for a benchmark.

def runWithBudget(bs: Array[Benchmark, r], budget: Int64): Int32 \ IO + r Source

Runs all benchmarks in bs. Attempts to spend no more than budget nanoseconds. One seconds is 1_000_000_000i64.