]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: avoid redefining clock type on Windows 50573/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 16 Mar 2023 14:25:50 +0000 (14:25 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 17 Mar 2023 13:38:56 +0000 (13:38 +0000)
commit4b50bb12f165af2da5de47b6dad255ce3fea2cfd
treee26d0e77839fffa1d7661f491a35b635dabf9245
parent3cf5c3f4bdf58b928a6bc226a20655abcda7f8fe
common: avoid redefining clock type on Windows

mingw >= 8.0.1 defines CLOCK_REALTIME_COARSE, so we'll avoid
overriding it if already set.

Clock precision [1]:

mingw < 8.0.1:
  * CLOCK_REALTIME: ~10-55ms (GetSystemTimeAsFileTime)
mingw >= 8.0.1:
  * CLOCK_REALTIME: <1us (GetSystemTimePreciseAsFileTime)
  * CLOCK_REALTIME_COARSE: ~10-55ms (GetSystemTimeAsFileTime)

* CLOCK_MONOTONIC: <1us if TSC is usable, ~10-55ms otherwise
                   (QueryPerformanceCounter)

[1] https://github.com/mirror/mingw-w64/commit/dcd990ed423381cf35702df9495d44f1979ebe50

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 489fd858479a79de75f6327d5cca40c289b53f35)
src/common/ceph_time.h