From 2d4eea89563a8493ffbeb119254a70192677de08 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Mon, 29 May 2023 20:05:18 -0400 Subject: [PATCH] tweak: time-printing tweaks. --- C-optimized/makefile | 2 +- C-optimized/samples-one-thread.c | 2 +- C-optimized/samples.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/C-optimized/makefile b/C-optimized/makefile index 75336782..9f33eebb 100644 --- a/C-optimized/makefile +++ b/C-optimized/makefile @@ -39,7 +39,7 @@ format: $(SRC) $(FORMATTER) $(SRC) run: $(SRC) $(OUTPUT) - OMP_NUM_THREADS=1 ./$(OUTPUT) + OMP_NUM_THREADS=1 ./$(OUTPUT) && echo ./$(OUTPUT_ONE_THREAD) time: diff --git a/C-optimized/samples-one-thread.c b/C-optimized/samples-one-thread.c index 2ae84321..bac15fea 100644 --- a/C-optimized/samples-one-thread.c +++ b/C-optimized/samples-one-thread.c @@ -174,7 +174,7 @@ int main() // array_print(dist_mixture[0], N); // end = clock(); - // printf("Time (ms): %f\n", ((double)(end - start)) / (CLOCKS_PER_SEC * 10) * 1000); + // printf("Time (ms): %f\n", ((double)(end - start)) / (CLOCKS_PER_SEC * 1000)); // ^ Will only measure how long it takes the inner main to run, not the whole program, // including e.g., loading the program into memory or smth. // Also CLOCKS_PER_SEC in POSIX is a constant equal to 1000000. diff --git a/C-optimized/samples.c b/C-optimized/samples.c index 9942d7ef..e8fec1f5 100644 --- a/C-optimized/samples.c +++ b/C-optimized/samples.c @@ -273,7 +273,7 @@ int main() split_array_free(dist_mixture, n_threads); // end = clock(); - // printf("Time (ms): %f\n", ((double)(end - start)) / (CLOCKS_PER_SEC * 10) * 1000); + // printf("Time (ms): %f\n", ((double)(end - start)) / (CLOCKS_PER_SEC) * 1000); // ^ Will only measure how long it takes the inner main to run, not the whole program, // including e.g., loading the program into memory or smth. // Also CLOCKS_PER_SEC in POSIX is a constant equal to 1000000.