From 2596f1d05b2faa57d152c006d6def9183417e465 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 5 Aug 1999 17:31:26 +0000 Subject: [PATCH] updated tests --- src/libCom/test/osiTimeTest.cc | 56 ++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/src/libCom/test/osiTimeTest.cc b/src/libCom/test/osiTimeTest.cc index 5622df558..2408550cc 100644 --- a/src/libCom/test/osiTimeTest.cc +++ b/src/libCom/test/osiTimeTest.cc @@ -1,9 +1,26 @@ #include +#include + +#include #include "tsDefs.h" #include "osiTime.h" #include "osiSleep.h" +#include "epicsAssert.h" + +#ifndef CLOCK_REALTIME + + // + // this is part of the POSIX RT standard but some OS + // still do not define this in time.h + // + struct timespec { + time_t tv_sec; /* seconds since some epoch */ + long tv_nsec; /* nanoseconds within the second */ + }; +#endif + int main () { @@ -11,23 +28,34 @@ int main () osiTime begin = osiTime::getCurrent(); const unsigned iter = 100000u; TS_STAMP stamp; + struct timespec ts; + struct tm tm; + tm_nano_sec ansiDate; char stampText[128]; + double diff; - for (i=0;i