improved tests
This commit is contained in:
7
src/libCom/test/Makefile
Normal file
7
src/libCom/test/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
TOP=../../..
|
||||
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
include $(TOP)/config/RULES_ARCHS
|
||||
|
||||
19
src/libCom/test/Makefile.Host
Normal file
19
src/libCom/test/Makefile.Host
Normal file
@@ -0,0 +1,19 @@
|
||||
# Makefile.Host for base/src/libCom
|
||||
#
|
||||
#
|
||||
|
||||
TOP = ../../../..
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
CMPLR = STRICT
|
||||
|
||||
USR_CFLAGS = -D_NO_PROTO
|
||||
|
||||
# libs needed for PROD and TESTPRODUCT
|
||||
PROD_LIBS := Com
|
||||
SYS_PROD_LIBS_WIN32 := ws2_32 advapi32
|
||||
|
||||
PROD = buckTest osiTimeTest
|
||||
|
||||
include $(TOP)/config/RULES.Host
|
||||
|
||||
# EOF Makefile.Host for base/src/libCom
|
||||
@@ -1,13 +1,16 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <osiTime.h>
|
||||
#include <winsock.h>
|
||||
#include "tsDefs.h"
|
||||
#include "osiTime.h"
|
||||
|
||||
void main ()
|
||||
int main ()
|
||||
{
|
||||
unsigned i;
|
||||
osiTime begin = osiTime::getCurrent();
|
||||
const unsigned iter = 1000000u;
|
||||
TS_STAMP stamp;
|
||||
char stampText[128];
|
||||
|
||||
for (i=0;i<iter;i++) {
|
||||
osiTime tmp = osiTime::getCurrent();
|
||||
@@ -15,5 +18,14 @@ void main ()
|
||||
|
||||
osiTime end = osiTime::getCurrent();
|
||||
|
||||
printf("elapsed per call to osiTime::getCurrent() = %f\n", ((double) (end-begin))/iter);
|
||||
printf ("elapsed per call to osiTime::getCurrent() = %f\n",
|
||||
((double) (end-begin))/iter);
|
||||
|
||||
stamp = osiTime::getCurrent();
|
||||
|
||||
tsStampToText (&stamp, TS_TEXT_MMDDYY, stampText);
|
||||
|
||||
printf ("osiTime::getCurrent() = %s\n", stampText);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user