summaryrefslogtreecommitdiffstats
path: root/apps/apps.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2005-11-06 16:16:38 +0000
committerAndy Polyakov <appro@openssl.org>2005-11-06 16:16:38 +0000
commita950f28762fbfa8dbb1c1c0f6234afd9fe6abe6d (patch)
tree4215b4bc5b5776db32a3434a2a3abd163830dd4b /apps/apps.c
parentc629204688430b5e1b81ea0e67489cd4dbbd05f7 (diff)
Revive app_tminterval for VMS.
Diffstat (limited to 'apps/apps.c')
-rw-r--r--apps/apps.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/apps/apps.c b/apps/apps.c
index d9a1316997..29a60a980f 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -2424,6 +2424,38 @@ double app_tminterval(int stop,int usertime)
return (ret);
}
+#elif defined(OPENSSL_SYSTEM_VMS)
+#include <time.h>
+#include <times.h>
+
+double app_tminterval(int stop,int usertime)
+ {
+ static clock_t tmstart;
+ double ret = 0;
+ clock_t now;
+#ifdef __TMS
+ struct tms rus;
+
+ now = times(&rus);
+ if (usertime) now = rus.tms_utime;
+#else
+ if (usertime)
+ now = clock(); /* sum of user and kernel times */
+ else {
+ struct timeval tv;
+ gettimeofday(&tv,NULL);
+ now = (clock_t)(
+ (unsigned long long)tv.tv_sec*CLK_TCK +
+ (unsigned long long)tv.tv_usec*(1000000/CLK_TCK)
+ );
+ }
+#endif
+ if (stop==TM_START) tmstart = now;
+ else ret = (now - tmstart)/(double)(CLK_TCK);
+
+ return (ret);
+ }
+
#elif defined(_SC_CLK_TCK) /* by means of unistd.h */
#include <sys/times.h>