From: Heng Li Date: Mon, 4 Apr 2011 16:15:35 +0000 (-0400) Subject: benchmark mergesort on sorted arrays X-Git-Tag: ksprintf-final~61 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=de4e7945fbb771a2a8815cf3a25641b896ecf84f;p=klib.git benchmark mergesort on sorted arrays --- diff --git a/ksort_test.c b/ksort_test.c index 4a4e9d0..f34f63a 100644 --- a/ksort_test.c +++ b/ksort_test.c @@ -65,6 +65,11 @@ int main(int argc, char *argv[]) } } + t1 = clock(); + ks_mergesort(int, N, array, 0); + t2 = clock(); + fprintf(stderr, "mergesort (sorted): %.3lf\n", (double)(t2-t1)/CLOCKS_PER_SEC); + srand48(11); for (i = 0; i < N; ++i) array[i] = (int)lrand48(); t1 = clock();