Add conditional compilation for windows and posix functions.
This adds a Windows-specific versions of several symbols from libcrypto and openssl(1).
This commit is contained in:
29
apps/apps_win.c
Normal file
29
apps/apps_win.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Public domain
|
||||
*
|
||||
* Dongsheng Song <dongsheng.song@gmail.com>
|
||||
* Brent Cook <bcook@openbsd.org>
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#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;
|
||||
}
|
Reference in New Issue
Block a user