No description
Find a file
2025-09-12 22:49:21 -04:00
src fix doNotOptimize and bump version 2025-09-12 22:49:21 -04:00
.gitignore init 2025-08-08 16:08:42 -04:00
anne_benchmark.h add support to use from C code. 2025-08-11 17:55:36 -04:00
build.zig add missing optimize arg 2025-08-22 21:58:06 -04:00
build.zig.zon fix doNotOptimize and bump version 2025-09-12 22:49:21 -04:00
Jenkinsfile fix target name 2025-08-14 16:31:20 -04:00
LICENSE add readme and license 2025-08-08 20:16:20 -04:00
README.md add support to use from C code. 2025-08-11 17:55:36 -04:00

Zig Benchmark Library

A simple benchmark library.

Using (zig):

  1. Import
  2. anne_benchmark.benchmark("my benchmark", someFunction);
  3. Profit!

Using (C):

  1. Include anne_benchmark.h
  2. Link against anne_benchmark.a
  3. benchmark_c("my benchmark", some_function);

Benchmarked function

Zig
pub fn someFunction(ctx: *anne_benchmark.Context) void {
    while (ctx.run()) {
        // do stuff...
    }
}
C
void some_function(ctx: *void) {
    while (benchmark_run(ctx)) {
        // do stuff...
    }
}

Advanced usage

See src/root.zig's Context.runExplicitTiming() documentation.