summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-09-25 16:30:05 +0200
committerJan Holesovsky <kendy@collabora.com>2014-09-25 21:57:37 +0200
commitd68ce6e173502e1b1ce214503f41729a8502cd92 (patch)
tree92565f97630910f1678e3eab2b465392884ca2ab /tools
parentc1f8437dbed0e8b989e41a345ef7e658a6e8a4cd (diff)
fdo#84000: Sort out problems with short timeouts & long callbacks.
Previously, the timer events could have accumulated in that scenario leading to unresponsiveness to user events. Change-Id: I455d726ae7475f7dbf98d871c54d8c156cb64e52
Diffstat (limited to 'tools')
-rw-r--r--tools/source/datetime/ttime.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx
index 71836e721689..66d16b4ce059 100644
--- a/tools/source/datetime/ttime.cxx
+++ b/tools/source/datetime/ttime.cxx
@@ -400,19 +400,18 @@ Time Time::GetUTCOffset()
sal_uIntPtr Time::GetSystemTicks()
{
#if defined WNT
- static LARGE_INTEGER nTicksPerMS;
- static bool bTicksPerMSInitialized = false;
- if (!bTicksPerMSInitialized)
+ static LARGE_INTEGER nTicksPerSecond;
+ static bool bTicksPerSecondInitialized = false;
+ if (!bTicksPerSecondInitialized)
{
- QueryPerformanceFrequency(&nTicksPerMS);
- nTicksPerMS.QuadPart /= 1000;
- bTicksPerMSInitialized = true;
+ QueryPerformanceFrequency(&nTicksPerSecond);
+ bTicksPerSecondInitialized = true;
}
LARGE_INTEGER nPerformanceCount;
QueryPerformanceCounter(&nPerformanceCount);
- return (sal_uIntPtr)(nPerformanceCount.QuadPart/nTicksPerMS.QuadPart);
+ return (sal_uIntPtr)((nPerformanceCount.QuadPart*1000)/nTicksPerSecond.QuadPart);
#else
timeval tv;
gettimeofday (&tv, 0);