Linux alternatives for the Windows headers and PerformanceCounter. Some typedefs and #defines for the Linux build. Fixed GetDataDir.

This commit is contained in:
sirius-m
2009-10-31 09:11:43 +00:00
parent 8938414f0c
commit e874738d3d
5 changed files with 40 additions and 12 deletions

12
util.h
View File

@@ -321,11 +321,19 @@ inline void PrintHex(vector<unsigned char> vch, const char* pszFormat="%s", bool
{
printf(pszFormat, HexStr(vch, fSpaces).c_str());
}
inline int64 PerformanceCounter()
{
int64 nCounter = 0;
QueryPerformanceCounter((LARGE_INTEGER*)&nCounter);
int64 nCounter = 0;
#ifdef __WXMSW__
QueryPerformanceCounter((LARGE_INTEGER*)&nCounter);
#else
// this could be changed to reading /dev/urandom
timeval t;
gettimeofday(&t, NULL);
nCounter += t.tv_sec * 1000000 + t.tv_usec;
#endif
return nCounter;
}