benchmark.c

Basic benchmarking library in C
git clone git://git.finwo.net/lib/benchmark.c
Log | Files | Refs | README | LICENSE

commit 8bc640e73facf33ce7d8a75a5a4d3d36cf6f203a
parent a2e34d849fd0cc941b1ca74e356ab18431d6c739
Author: finwo <finwo@pm.me>
Date:   Sat, 25 Mar 2023 00:30:49 +0100

Make the table output valid markdown

Diffstat:
Msrc/benchmark.c | 19++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/src/benchmark.c b/src/benchmark.c @@ -61,22 +61,17 @@ int bmark_run(int run_count, char percentiles[]) { printf("\n"); - // Separator - printf("+-"); - for(i = 0 ; i < header_desclen ; i++) printf("-"); - for(i = 0 ; percentiles[i] ; i++) printf("-+----------"); - printf("-+\n"); - // Column names printf("| %-*s |", header_desclen, header_description); for(i = 0 ; percentiles[i] ; i++) printf(" %*d %% |", 7, percentiles[i]); printf("\n"); // Separator - printf("+-"); + printf("|:"); for(i = 0 ; i < header_desclen ; i++) printf("-"); - for(i = 0 ; percentiles[i] ; i++) printf("-+----------"); - printf("-+\n"); + printf(" |"); + for(i = 0 ; percentiles[i] ; i++) printf(" ---------:|"); + printf("\n"); // Go over the whole queue q_entry = bmark_queue; @@ -121,12 +116,6 @@ int bmark_run(int run_count, char percentiles[]) { q_entry = q_entry->next; } - // Separator - printf("+-"); - for(i = 0 ; i < header_desclen ; i++) printf("-"); - for(i = 0 ; percentiles[i] ; i++) printf("-+----------"); - printf("-+\n"); - printf("\n"); return 0; }