summaryrefslogtreecommitdiffstats
path: root/apps/apps.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2005-11-06 16:55:44 +0000
committerAndy Polyakov <appro@openssl.org>2005-11-06 16:55:44 +0000
commitd88fcf73f19fc63095929eaa531cbd4680c3f75c (patch)
tree679a02ab171442495232775dc468d4b83ff94d14 /apps/apps.c
parenta950f28762fbfa8dbb1c1c0f6234afd9fe6abe6d (diff)
Revive app_tminterval for vxworks.
Diffstat (limited to 'apps/apps.c')
-rw-r--r--apps/apps.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/apps/apps.c b/apps/apps.c
index 29a60a980f..4468e50494 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -2401,7 +2401,7 @@ double app_tminterval(int stop,int usertime)
{
BIO_printf(bio_err,"To get meaningful results, run "
"this program on idle system.\n");
- warning=1;
+ warning=0;
}
GetSystemTime(&systime);
SystemTimeToFileTime(&systime,&now);
@@ -2424,6 +2424,41 @@ double app_tminterval(int stop,int usertime)
return (ret);
}
+#elif defined(OPENSSL_SYSTEM_VXWORKS)
+#include <time.h>
+
+double app_tminterval(int stop,int usertime)
+ {
+ double ret=0;
+#ifdef CLOCK_REALTIME
+ static struct timespec tmstart;
+ struct timespec now;
+#else
+ static unsigned long tmstart;
+ unsigned long now;
+#endif
+ static int warning=1;
+
+ if (usertime && warning)
+ {
+ BIO_printf(bio_err,"To get meaningful results, run "
+ "this program on idle system.\n");
+ warning=0;
+ }
+
+#ifdef CLOCK_REALTIME
+ clock_gettime(CLOCK_REALTIME,&now);
+ if (stop==TM_START) tmstart = now;
+ else ret = ( (now.tv_sec+now.tv_nsec*1e-9)
+ - (tmstart.tv_sec+tmstart.tv_nsec*1e-9) );
+#else
+ now = tickGet();
+ if (stop==TM_START) tmstart = now;
+ else ret = (now - tmstart)/(double)sysClkRateGet();
+#endif
+ return (ret);
+ }
+
#elif defined(OPENSSL_SYSTEM_VMS)
#include <time.h>
#include <times.h>