improved tests

This commit is contained in:
Jeff Hill
1999-05-05 18:00:12 +00:00
parent 3ee23236b5
commit b4cc937af1
3 changed files with 42 additions and 4 deletions

7
src/libCom/test/Makefile Normal file
View File

@@ -0,0 +1,7 @@
TOP=../../..
include $(TOP)/config/CONFIG_BASE
include $(TOP)/config/RULES_ARCHS

View 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

View File

@@ -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;
}