X-Git-Url: https://git.sesse.net/?p=fjl;a=blobdiff_plain;f=idct_test.c;h=cf2556bd2fc5ee87f85d2eac09d62d48e46e5955;hp=e35a17b1b760edbe8ea104ea239abef5160ab7d4;hb=4b87e80c1ee4dd6a5d5c13e7b4321a956f53378f;hpb=1c432c018bc1ac92c5b327312fb9d21f666ca0e0 diff --git a/idct_test.c b/idct_test.c index e35a17b..cf2556b 100644 --- a/idct_test.c +++ b/idct_test.c @@ -3,9 +3,8 @@ #include #include #include -#include -#include +#include "benchmark.h" #include "idct.h" // Generate random coefficients in the range [-15..15]. @@ -99,17 +98,14 @@ void test_performance(idct_func_t* idct) quant[i] = 1; } - struct timeval start, now; - gettimeofday(&start, NULL); + start_benchmark_timer(); for (unsigned i = 0; i < num_runs; ++i) { (*idct)(coeff, quant, output); } - gettimeofday(&now, NULL); - - double diff = timediff(&start, &now); - printf("%u runs in %.2f seconds = %.2f IDCTs/sec\n", + double diff = stop_benchmark_timer(); + printf("%u runs in %.2f CPU seconds = %.2f IDCTs/sec\n", num_runs, diff, num_runs / diff); }