12 #define __need_timespec 18 #include "rtxsrc/wceAddon.h" 26 #define ITERCNT 10000L 38 unsigned long encodeMsecs;
39 unsigned long decodeMsecs;
45 #define DECLARE_BENCHMARK \ 46 struct timespec tp0, tp1, tp2, tp3; \ 48 double __maxms__ = 0, __minms__ = 10000000000000.f; 51 clock_gettime(CLOCK_REALTIME, &tp0); 54 clock_gettime(CLOCK_REALTIME, &tp1); 58 for (__clk__ = 0; __clk__ < ITERCNT; __clk__ ++) { \ 59 clock_gettime(CLOCK_REALTIME, &tp2); 62 clock_gettime(CLOCK_REALTIME, &tp3); \ 63 long _dst = tp3.tv_sec - tp2.tv_sec, \ 64 _dnt = tp3.tv_nsec - tp2.tv_nsec; \ 65 double _dmst = (_dst * 1000.f) + (_dnt / 1e6); \ 67 if (_dmst < __minms__) __minms__ = _dmst; \ 68 if (_dmst > __maxms__) __maxms__ = _dmst; \ 72 #define PRINT_RESULTS_MS \ 73 long _ds = tp1.tv_sec - tp0.tv_sec, \ 74 _dn = tp1.tv_nsec - tp0.tv_nsec; \ 75 double _dms = (_ds * 1000.f) + (_dn / 1e6); \ 76 printf ("\t%.6f\t%.6f\t%.6f\t%.6f\n", _dms, __minms__, __maxms__, \ 91 void rtxBenchPrintResults
92 (
const char* filename,
const OSRTBenchmarkData* pdata);
Common runtime functions for diagnostic tracing and debugging.
double rtxBenchAverageMS(clock_t start, clock_t finish, double icnt)
This function calculates the average number of milliseconds a test takes given the starting time...