From 0204b27182f8c92a75d88909665aa236ee2ea7ab Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 14 Aug 2022 16:56:38 +0000 Subject: [PATCH] Move getTimeMS() to Util --- src/defines.h | 2 -- src/main.cc | 7 ------- src/osdopengl.cc | 1 + src/osdopenvg.cc | 1 + src/util.cc | 6 ++++++ src/util.h | 1 + 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/defines.h b/src/defines.h index 884d0d4..dfdc771 100644 --- a/src/defines.h +++ b/src/defines.h @@ -49,8 +49,6 @@ typedef uint64_t u8; // Global useful functions -long long getTimeMS(); - int getClockRealTime(struct timespec *tp); //#define WINDOWS_LEGACY diff --git a/src/main.cc b/src/main.cc index 9a0f1a8..38f0014 100644 --- a/src/main.cc +++ b/src/main.cc @@ -312,13 +312,6 @@ void threadSignalReceiverFunction() // ------------------------------------------------------------------------------------------------------------------- -long long getTimeMS() -{ - struct timespec ts; - clock_gettime(VOMP_LINUX_CLOCK, &ts); - return ts.tv_sec * 1000 + ts.tv_nsec / 1000000LL; -} - int getClockRealTime(struct timespec *tp) // FIXME - del if all goes chrono { return clock_gettime(CLOCK_REALTIME, tp); diff --git a/src/osdopengl.cc b/src/osdopengl.cc index f7f2643..f22051b 100644 --- a/src/osdopengl.cc +++ b/src/osdopengl.cc @@ -21,6 +21,7 @@ #include "surfaceopengl.h" #include "message.h" #include "control.h" +#include "util.h" #include "osdopengl.h" diff --git a/src/osdopenvg.cc b/src/osdopenvg.cc index 39f9922..541a76e 100644 --- a/src/osdopenvg.cc +++ b/src/osdopenvg.cc @@ -29,6 +29,7 @@ #include "surface.h" #include "messagequeue.h" #include "teletxt/txtfont.h" +#include "util.h" #include "osdopenvg.h" diff --git a/src/util.cc b/src/util.cc index 6644b82..9de8590 100644 --- a/src/util.cc +++ b/src/util.cc @@ -128,3 +128,9 @@ int min(UINT a, int b) else return a; } +i8 getTimeMS() +{ + struct timespec ts; + clock_gettime(VOMP_LINUX_CLOCK, &ts); + return ts.tv_sec * 1000 + ts.tv_nsec / 1000000LL; +} diff --git a/src/util.h b/src/util.h index b91e15e..5db86d4 100644 --- a/src/util.h +++ b/src/util.h @@ -28,6 +28,7 @@ void MILLISLEEP(u4 a); std::string tp2str(const std::chrono::time_point& tp); void dump(void* data, int length); +i8 getTimeMS(); //u8 htonll(u8 a); //u8 ntohll(u8 a); -- 2.39.5