Kaydet (Commit) 168782a6 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

Remove 500ns offset from GetSystemTicks()

This doesn't make any sense. The orignal idea might have been to
somehow be in the middle of 1ms, for whatever reason.

And it completely breaks, if we want to sleep 0ms.

Change-Id: I525b70c016876a96aa17edefe8c076b122ee2527
üst 3b9a535e
...@@ -433,7 +433,7 @@ sal_uInt64 tools::Time::GetSystemTicks() ...@@ -433,7 +433,7 @@ sal_uInt64 tools::Time::GetSystemTicks()
SAL_WARN("tools.datetime", "gettimeofday failed: " << e); SAL_WARN("tools.datetime", "gettimeofday failed: " << e);
} }
return static_cast<sal_uInt64>(tv.tv_sec) * 1000 return static_cast<sal_uInt64>(tv.tv_sec) * 1000
+ (static_cast<sal_uInt64>(tv.tv_usec) + 500) / 1000; + static_cast<sal_uInt64>(tv.tv_usec) / 1000;
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment