aboutsummaryrefslogtreecommitdiff
path: root/modules/benchmark/fib.c
diff options
context:
space:
mode:
authorSimon Quigley <tsimonq2@ubuntu.com>2018-02-27 22:34:48 -0600
committerSimon Quigley <tsimonq2@ubuntu.com>2018-02-27 22:34:48 -0600
commit09fcc751ef158898c315ebc9299a0fa3a722d914 (patch)
tree91116653d831ca5de92274277237ba2a42db3365 /modules/benchmark/fib.c
parent11e616945340e87a1f567ab92e6dfac3068875b1 (diff)
New upstream version 0.5.1+git20180227
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;
}