Back to project.

Raw source file available here .

// Written by retoor@molodetz.nl

// This program defines a dummy function that multiplies each number in a loop by two. It also sets up a benchmarking tool, executes it a
// number of times, and cleans up the used resources.

// Includes the "rlib.h" library to utilize benchmarking functions.

// MIT License: This software is provided "as-is", without any express or implied warranty. In no event will the authors be held liable for
// any damages arising from the use of this software.

#include "rlib.h"

void dummy_function() {
for (long i = 0; i < 100000; i++) {
long a = i * 2;
}
}

int main() {
rbench_t *r = rbench_new();
r->add_function(r, "function", "dummy_function", dummy_function);
r->execute(r, 10000);
rbench_free(r);

for (int i = 0; i < 10000; i++) {
}
}