aboutsummaryrefslogtreecommitdiffstats
path: root/apps/s_time.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-02-14 15:37:38 +0000
committerRichard Levitte <levitte@openssl.org>2002-02-14 15:37:38 +0000
commit3e83e686ba2e21a2d7d991446bc6fedde5ff58c0 (patch)
treed8330c1735352c6b85a98a49ef79c97dbd096290 /apps/s_time.c
parent8f06b003736c957c6e693d3b5dd1393f91a530cd (diff)
downloadopenssl-3e83e686ba2e21a2d7d991446bc6fedde5ff58c0.tar.gz
Add the configuration target VxWorks.
Diffstat (limited to 'apps/s_time.c')
-rw-r--r--apps/s_time.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/apps/s_time.c b/apps/s_time.c
index 9ce114dcb6..2fb853d071 100644
--- a/apps/s_time.c
+++ b/apps/s_time.c
@@ -85,7 +85,7 @@
#include OPENSSL_UNISTD
#endif
-#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX)
+#if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX)
#define TIMES
#endif
@@ -105,7 +105,7 @@
#undef TIMES
#endif
-#ifndef TIMES
+#if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS)
#include <sys/timeb.h>
#endif
@@ -150,6 +150,8 @@
#undef BUFSIZZ
#define BUFSIZZ 1024*10
+#undef min
+#undef max
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
@@ -379,6 +381,22 @@ static double tm_Time_F(int s)
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
return((ret == 0.0)?1e-6:ret);
}
+#elif defined(OPENSSL_SYS_VXWORKS)
+ {
+ static unsigned long tick_start, tick_end;
+
+ if( s == START )
+ {
+ tick_start = tickGet();
+ return 0;
+ }
+ else
+ {
+ tick_end = tickGet();
+ ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
+ return((ret == 0.0)?1e-6:ret);
+ }
+ }
#else /* !times() */
static struct timeb tstart,tend;
long i;