diff options
author | sirius-m <sirius-m@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2009-10-31 09:11:43 +0000 |
---|---|---|
committer | sirius-m <sirius-m@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2009-10-31 09:11:43 +0000 |
commit | fe9f3d626d79f71d819caf43878299fa5e6af83e (patch) | |
tree | 6f8b6bdd3a53a58371dacb507d06ae6aaa18daf3 /util.h | |
parent | 32d490313b21d5cea64f99ca9db4388591bb3ab9 (diff) |
Linux alternatives for the Windows headers and PerformanceCounter. Some typedefs and #defines for the Linux build. Fixed GetDataDir.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@23 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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;
}
|