summaryrefslogtreecommitdiff
path: root/zen/tick_count.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2015-10-02 14:52:29 +0200
committerDaniel Wilhelm <daniel@wili.li>2015-10-02 14:52:29 +0200
commitd3e1925aa7388cd842408032621fae29133dd971 (patch)
tree02e0bd2fdc4bf0214d15c829d9ad5eebb0a03d38 /zen/tick_count.h
parent6.8 (diff)
downloadFreeFileSync-d3e1925aa7388cd842408032621fae29133dd971.tar.gz
FreeFileSync-d3e1925aa7388cd842408032621fae29133dd971.tar.bz2
FreeFileSync-d3e1925aa7388cd842408032621fae29133dd971.zip
6.9
Diffstat (limited to 'zen/tick_count.h')
-rw-r--r--zen/tick_count.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/zen/tick_count.h b/zen/tick_count.h
index cb15fe20..482689d7 100644
--- a/zen/tick_count.h
+++ b/zen/tick_count.h
@@ -102,7 +102,7 @@ int64_t ticksPerSec() //return 0 on error
#ifdef ZEN_WIN
LARGE_INTEGER frequency = {};
if (!::QueryPerformanceFrequency(&frequency)) //MSDN promises: "The frequency cannot change while the system is running."
- return 0;
+ return 0; //MSDN: "This won't occur on any system that runs Windows XP or later."
static_assert(sizeof(int64_t) >= sizeof(frequency.QuadPart), "");
return frequency.QuadPart;
@@ -126,8 +126,10 @@ TickVal getTicks() //return !isValid() on error
{
#ifdef ZEN_WIN
LARGE_INTEGER now = {};
- if (!::QueryPerformanceCounter(&now)) //msdn: SetThreadAffinityMask() may be required if there are bugs in BIOS or HAL"
+ if (!::QueryPerformanceCounter(&now))
return TickVal();
+ //detailed info about QPC: http://msdn.microsoft.com/en-us/library/windows/desktop/dn553408%28v=vs.85%29.aspx
+ //- MSDN: "No need to set the thread affinity"
#elif defined ZEN_LINUX
//gettimeofday() seems fine but is deprecated
bgstack15