Skip to content
Snippets Groups Projects
Commit 8e9916ce authored by deuce's avatar deuce
Browse files

Set the value to the fractional part first, then add the integral part.

This *should* result in the highest possible resolution.
parent 4c700a32
Branches
Tags
No related merge requests found
......@@ -515,8 +515,8 @@ long double DLLCALL xp_timer(void)
ret /= ((long double)freq.HighPart*4294967296)+((long double)freq.LowPart);
#else
/* In MSVC, a long double does NOT have 19 decimals of precision */
ret=((long long int)(tick.QuadPart/freq.QuadPart))
+(((long double)(tick.QuadPart%freq.QuadPart))/freq.QuadPart);
ret=(((long double)(tick.QuadPart%freq.QuadPart))/freq.QuadPart);
ret+=((long long int)(tick.QuadPart/freq.QuadPart))
#endif
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment