From d032c5d12a394f2606adf901d2f4cbb82eaaefe4 Mon Sep 17 00:00:00 2001 From: redstrate Date: Tue, 9 Nov 2021 20:59:39 -0500 Subject: [PATCH] Add Linux support for TickCount() --- src/xivlauncher.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xivlauncher.cpp b/src/xivlauncher.cpp index aa37cff..0380a32 100755 --- a/src/xivlauncher.cpp +++ b/src/xivlauncher.cpp @@ -69,6 +69,16 @@ uint32_t TickCount() { } #endif +#if defined(Q_OS_LINUX) +uint32_t TickCount() { + struct timespec ts; + + clock_gettime(CLOCK_MONOTONIC, &ts); + + return (ts.tv_sec * 1000 + ts.tv_nsec / 1000000); +} +#endif + #if defined(Q_OS_WIN) uint32_t TickCount() { return GetTickCount();