aboutsummaryrefslogtreecommitdiff
path: root/heap.c
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2020-11-29 15:57:07 +0100
committerThomas Schmucker <ts@its1.de>2020-11-29 15:57:07 +0100
commitf2822a2c43675ebb9d8fc5ccfdf5e1763511a555 (patch)
tree2c5ee8064f76ae45b932ef240d55a6627544b8d6 /heap.c
parent6af11155551496fa173f96759f0f36774a0fb503 (diff)
downloaddata-structures-f2822a2c43675ebb9d8fc5ccfdf5e1763511a555.tar.gz
data-structures-f2822a2c43675ebb9d8fc5ccfdf5e1763511a555.tar.bz2
data-structures-f2822a2c43675ebb9d8fc5ccfdf5e1763511a555.zip
Geschwindigkeitsmessung bei Heapsort.
Diffstat (limited to 'heap.c')
-rw-r--r--heap.c4
1 files changed, 3 insertions, 1 deletions
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)
191 } 191 }
192 192
193 puts("sortiere...."); 193 puts("sortiere....");
194 clock_t start = clock();
194 my_heapsort(array, NELEM(array)); 195 my_heapsort(array, NELEM(array));
196 clock_t end = clock();
195 197
196 puts("teste..."); 198 puts("teste...");
197 for ( size_t idx = 1; idx != NELEM(array); ++idx ) { 199 for ( size_t idx = 1; idx != NELEM(array); ++idx ) {
@@ -207,7 +209,7 @@ test_heapsort(void)
207 } 209 }
208#endif 210#endif
209 } 211 }
210 puts("ok"); 212 printf("ok! (%.3lf sec)\n", ((double) end - start) / CLOCKS_PER_SEC);
211} 213}
212 214
213void 215void