mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-18 23:41:08 +02:00
fixed overflow bug on Windows
This commit is contained in:
parent
8e88bdd921
commit
a005d582bc
@ -104,7 +104,8 @@ void Clock::update()
|
|||||||
LARGE_INTEGER perfFreq;
|
LARGE_INTEGER perfFreq;
|
||||||
if (QueryPerformanceCounter(&perfCounter) && QueryPerformanceFrequency(&perfFreq))
|
if (QueryPerformanceCounter(&perfCounter) && QueryPerformanceFrequency(&perfFreq))
|
||||||
{
|
{
|
||||||
_clock = perfCounter.QuadPart*resolution()/perfFreq.QuadPart;
|
_clock = resolution()*(perfCounter.QuadPart/perfFreq.QuadPart);
|
||||||
|
_clock += (perfCounter.QuadPart % perfFreq.QuadPart)*resolution()/perfFreq.QuadPart;
|
||||||
}
|
}
|
||||||
else throw Poco::SystemException("cannot get system clock");
|
else throw Poco::SystemException("cannot get system clock");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user