From 58fcd3c39c73d83eb9782a8ef935498b18b5ae73 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 20 Nov 2014 00:26:55 -0600 Subject: Add conditional compilation for windows and posix functions. This adds a Windows-specific versions of several symbols from libcrypto and openssl(1). --- apps/apps_win.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 apps/apps_win.c (limited to 'apps') diff --git a/apps/apps_win.c b/apps/apps_win.c new file mode 100644 index 0000000..496ac03 --- /dev/null +++ b/apps/apps_win.c @@ -0,0 +1,29 @@ +/* + * Public domain + * + * Dongsheng Song + * Brent Cook + */ + +#include + +#include "apps.h" + +double +app_tminterval(int stop, int usertime) +{ + static unsigned __int64 tmstart; + union { + unsigned __int64 u64; + FILETIME ft; + } ct, et, kt, ut; + + GetProcessTimes(GetCurrentProcess(), &ct.ft, &et.ft, &kt.ft, &ut.ft); + + if (stop == TM_START) { + tmstart = ut.u64 + kt.u64; + } else { + return (ut.u64 + kt.u64 - tmstart) / (double) 10000000; + } + return 0; +} -- cgit v1.2.3-55-g6feb