diff options
| author | Tyge Lovset <[email protected]> | 2023-04-09 10:37:16 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-04-09 10:37:16 +0200 |
| commit | 0a32a32b06170ad588ec837a86df9e3f419c2f4d (patch) | |
| tree | 4518d627bc9a4e270e9d6aaed29ac24e959f38b5 /misc/benchmarks/various | |
| parent | 43120f2863a67db416ec3b379eb820e2704cafb7 (diff) | |
| download | STC-modified-0a32a32b06170ad588ec837a86df9e3f419c2f4d.tar.gz STC-modified-0a32a32b06170ad588ec837a86df9e3f419c2f4d.zip | |
Final commit before 4.2 release?
Diffstat (limited to 'misc/benchmarks/various')
| -rw-r--r-- | misc/benchmarks/various/csort_bench.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/misc/benchmarks/various/csort_bench.c b/misc/benchmarks/various/csort_bench.c index 37cdf53d..d5d7fa7c 100644 --- a/misc/benchmarks/various/csort_bench.c +++ b/misc/benchmarks/various/csort_bench.c @@ -17,12 +17,18 @@ uint64_t romutrio(uint64_t s[3]) { return xp; } +static int cmp_int(const void* a, const void* b) { + return c_default_cmp((const int*)a, (const int*)b); +} + void testsort(int *a, int size, const char *desc) { clock_t t = clock(); #ifdef __cplusplus - { printf("std::sort: "); std::sort(a, a + size); } + printf("std::sort: "); std::sort(a, a + size); +#elif defined QSORT + printf("qsort: "); qsort(a, size, sizeof *a, cmp_int); #else - { printf("stc_sort: "); csort_int(a, size); } + printf("stc_sort: "); csort_int(a, size); #endif t = clock() - t; |
