From f2822a2c43675ebb9d8fc5ccfdf5e1763511a555 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sun, 29 Nov 2020 15:57:07 +0100 Subject: Geschwindigkeitsmessung bei Heapsort. --- heap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/heap.c b/heap.c index 6ad3010..006ec57 100644 --- a/heap.c +++ b/heap.c @@ -191,7 +191,9 @@ test_heapsort(void) } puts("sortiere...."); + clock_t start = clock(); my_heapsort(array, NELEM(array)); + clock_t end = clock(); puts("teste..."); for ( size_t idx = 1; idx != NELEM(array); ++idx ) { @@ -207,7 +209,7 @@ test_heapsort(void) } #endif } - puts("ok"); + printf("ok! (%.3lf sec)\n", ((double) end - start) / CLOCKS_PER_SEC); } void -- cgit v1.3