From 32009294d2de3e197c8d4dc950559ff948ea2fc9 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 4 Oct 2024 08:58:47 +0200 Subject: Clean up tool output --- tools/tool.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'tools/tool.h') diff --git a/tools/tool.h b/tools/tool.h index c44828d..9fee050 100644 --- a/tools/tool.h +++ b/tools/tool.h @@ -10,7 +10,7 @@ static void log_stderr(const char *, ...); static void log_stdout(const char *, ...); -static double timerun(void (*)(void), const char *); +static double timerun(void (*)(void)); static void getfilename(const char *, const char *, char *); static void writetable(const char *, int64_t, const char *); static int64_t generatetable(const char *, const char *, char **); @@ -41,24 +41,19 @@ write_stdout(const char *str, ...) } static double -timerun(void (*run)(void), const char *name) +timerun(void (*run)(void)) { struct timespec start, end; double tdiff, tdsec, tdnano; - printf("\n"); fflush(stdout); if (run == NULL) { - printf("> %s: nothing to run!\n", name); + printf("nothing to run!\n"); fflush(stdout); return -1.0; } - printf("Running tool: %s\n", name); - printf("==========\n"); - fflush(stdout); - clock_gettime(CLOCK_MONOTONIC, &start); run(); clock_gettime(CLOCK_MONOTONIC, &end); @@ -67,7 +62,7 @@ timerun(void (*run)(void), const char *name) tdnano = end.tv_nsec - start.tv_nsec; tdiff = tdsec + 1e-9 * tdnano; - printf("==========\n"); + printf("---------\n"); printf("\nTotal time: %.4fs\n", tdiff); fflush(stdout); -- cgit v1.3