diff options
Diffstat (limited to 'src/base/test.c')
-rw-r--r-- | src/base/test.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/base/test.c b/src/base/test.c index de53125..6baaf78 100644 --- a/src/base/test.c +++ b/src/base/test.c @@ -19,23 +19,21 @@ test·sort() { clock_t t; int i, test[10000]; - for (i = 0; i < arrlen(test); i++) { - test[i] = rand(); - } + for(i = 0; i < arrlen(test); i++) + test[i] = rng·randi(1000000); t = clock(); sort·int(arrlen(test), test); t = clock() - t; - printf("inlined code took %f ms to execute\n", 1000.*t/CLOCKS_PER_SEC); + fmt·print("inlined code took %f ms to execute\n", 1000.*t/CLOCKS_PER_SEC); - for (i = 0; i < arrlen(test); i++) { - test[i] = rand(); - } + for (i = 0; i < arrlen(test); i++) + test[i] = rng·randi(1000000); t = clock(); - qsort(test, arrlen(test), sizeof(int), (int (*)(const void *, const void *))less); + /* qsort(test, arrlen(test), sizeof(int), (int (*)(const void *, const void *))less); */ t = clock() - t; - printf("std qsort code took %f ms to execute\n", 1000.*t/CLOCKS_PER_SEC); + fmt·print("std qsort code took %f ms to execute\n", 1000.*t/CLOCKS_PER_SEC); /* for (i = 1; i < arrlen(test); i++) { |