#include #include #include #include "osiTime.h" #include "osiThread.h" #include "errlog.h" extern "C" { int osiTimeTest (void); } int osiTimeTest (void) { unsigned i, errors, sum_errors=0, sum_errloops=0; osiTime begin = osiTime::getCurrent(); const unsigned wasteTime = 100000u; const int nTimes = 100; TS_STAMP stamp; struct timespec ts; struct tm tmAnsi; tm_nano_sec ansiDate; unsigned long nanoSec; double diff; printf ("osiTime Test (%3d loops)\n========================\n\n", nTimes); for (int iTimes=0; iTimes < nTimes; ++iTimes) { for (i=0; i=end)) { printf ("#%3d: Failed copy>=end by %12.9f\n", iTimes, (end-copy)); errors += 1; } if (!(end>begin)) { printf ("#%3d: Failed end>begin by %12.9f\n", iTimes, (begin-end)); errors += 1; } if (!(end>=begin)) { printf ("#%3d: Failed end>=begin by %12.9f\n", iTimes, (begin-end)); errors += 1; } if (!(begin