aboutsummaryrefslogtreecommitdiff
path: root/modules/benchmark/fib.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/benchmark/fib.c')
-rw-r--r--modules/benchmark/fib.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/benchmark/fib.c b/modules/benchmark/fib.c
index 0f88be59..d75ac367 100644
--- a/modules/benchmark/fib.c
+++ b/modules/benchmark/fib.c
@@ -18,8 +18,7 @@
#include "benchmark.h"
-static gulong
-fib(gulong n)
+gulong fib(gulong n)
{
if (n == 0)
return 0;
@@ -32,19 +31,22 @@ void
benchmark_fib(void)
{
GTimer *timer = g_timer_new();
- gdouble elapsed;
-
+ bench_value r = EMPTY_BENCH_VALUE;
+
shell_view_set_enabled(FALSE);
shell_status_update("Calculating the 42nd Fibonacci number...");
-
+
g_timer_reset(timer);
g_timer_start(timer);
fib(42);
-
+
g_timer_stop(timer);
- elapsed = g_timer_elapsed(timer, NULL);
+ r.elapsed_time = g_timer_elapsed(timer, NULL);
g_timer_destroy(timer);
-
- bench_results[BENCHMARK_FIB] = elapsed;
+
+ r.threads_used = 1;
+ r.result = r.elapsed_time;
+
+ bench_results[BENCHMARK_FIB] = r;
}