aboutsummaryrefslogtreecommitdiff
path: root/modules/benchmark/fib.c
diff options
context:
space:
mode:
authorSimon Quigley <tsimonq2@ubuntu.com>2018-02-27 22:34:49 -0600
committerSimon Quigley <tsimonq2@ubuntu.com>2018-02-27 22:34:49 -0600
commit00831e690c4581ee8f0f92902ebdb75304bde817 (patch)
tree55a37b9cc5d60ad047631ffb39d2f822a22d6d39 /modules/benchmark/fib.c
parentd95f107ef2b9e82c341060be0def97d7bfa430b9 (diff)
parent09fcc751ef158898c315ebc9299a0fa3a722d914 (diff)
Update upstream source from tag 'upstream/0.5.1+git20180227'
Update to upstream version '0.5.1+git20180227' with Debian dir 7ca675e2ccb4367b7cc5b255a36b5173afaf9d2c
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;
}