From 0fb339fd9dc30b997c76563271e9b3e3f24db84d Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sat, 19 Jan 2019 19:17:46 +0100 Subject: some more example --- test/monniaux/heapsort/heapsort_run.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/monniaux/heapsort/heapsort_run.c (limited to 'test/monniaux/heapsort/heapsort_run.c') diff --git a/test/monniaux/heapsort/heapsort_run.c b/test/monniaux/heapsort/heapsort_run.c new file mode 100644 index 00000000..76378067 --- /dev/null +++ b/test/monniaux/heapsort/heapsort_run.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include "heapsort.h" +#include "../cycles.h" + +int main (void) { + cycle_count_config(); + unsigned len=30000; + data *vec = malloc(sizeof(data) * len); + data_vec_random(vec, len); + cycle_t heapsort_time = get_cycle(); + heapsort(vec, len); + heapsort_time = get_cycle() - heapsort_time; + printf("sorted=%s\n" + "heapsort_time=%" PRIu64 "\n", + data_vec_is_sorted(vec, len)?"true":"false", + heapsort_time); + free(vec); + return 0; +} + -- cgit From 4f3b7c0d75fd90ac064419d19d7af2e340d516aa Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 17 May 2019 12:03:18 +0200 Subject: Adding more measures --- test/monniaux/heapsort/heapsort_run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/monniaux/heapsort/heapsort_run.c') diff --git a/test/monniaux/heapsort/heapsort_run.c b/test/monniaux/heapsort/heapsort_run.c index 76378067..053822a3 100644 --- a/test/monniaux/heapsort/heapsort_run.c +++ b/test/monniaux/heapsort/heapsort_run.c @@ -13,7 +13,7 @@ int main (void) { heapsort(vec, len); heapsort_time = get_cycle() - heapsort_time; printf("sorted=%s\n" - "heapsort_time=%" PRIu64 "\n", + "heapsort_time:%" PRIu64 "\n", data_vec_is_sorted(vec, len)?"true":"false", heapsort_time); free(vec); -- cgit From b288b587378984c3c419d26a13dcf93686d1b779 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 17 Jul 2019 12:03:39 +0200 Subject: All working benches ported --- test/monniaux/heapsort/heapsort_run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/monniaux/heapsort/heapsort_run.c') diff --git a/test/monniaux/heapsort/heapsort_run.c b/test/monniaux/heapsort/heapsort_run.c index 053822a3..8f2d3fe0 100644 --- a/test/monniaux/heapsort/heapsort_run.c +++ b/test/monniaux/heapsort/heapsort_run.c @@ -13,7 +13,7 @@ int main (void) { heapsort(vec, len); heapsort_time = get_cycle() - heapsort_time; printf("sorted=%s\n" - "heapsort_time:%" PRIu64 "\n", + "time cycles:%" PRIu64 "\n", data_vec_is_sorted(vec, len)?"true":"false", heapsort_time); free(vec); -- cgit