aboutsummaryrefslogtreecommitdiff
path: root/benchtests/bench-skeleton.c
diff options
context:
space:
mode:
Diffstat (limited to 'benchtests/bench-skeleton.c')
-rw-r--r--benchtests/bench-skeleton.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/benchtests/bench-skeleton.c b/benchtests/bench-skeleton.c
index 4290e76f31..faef7ebf9a 100644
--- a/benchtests/bench-skeleton.c
+++ b/benchtests/bench-skeleton.c
@@ -59,8 +59,13 @@ main (int argc, char **argv)
iters = 1000 * res;
+ /* Begin function. */
+ printf ("\"%s\": {\n", FUNCNAME);
+
for (int v = 0; v < NUM_VARIANTS; v++)
{
+ if (v)
+ putc (',', stdout);
/* Run for approximately DURATION seconds. */
clock_gettime (CLOCK_MONOTONIC_RAW, &runtime);
runtime.tv_sec += DURATION;
@@ -86,7 +91,6 @@ main (int argc, char **argv)
min = cur;
TIMING_ACCUM (total, cur);
-
d_total_i += iters;
}
struct timespec curtime;
@@ -104,9 +108,17 @@ main (int argc, char **argv)
d_total_s = total;
d_iters = iters;
- TIMING_PRINT_STATS (VARIANT (v), d_total_s, d_iters, d_total_i, max,
- min);
+ printf ("\"%s\": {\n", VARIANT (v));
+ printf ("\"duration\": %g, \"iterations\": %g, "
+ "\"max\": %g, \"min\": %g, \"mean\": %g\n",
+ d_total_s, d_total_i, max / d_iters, min / d_iters,
+ d_total_s / d_total_i);
+
+ puts ("}");
}
+ /* End function. */
+ puts ("}");
+
return 0;
}