From a759d1fae861e7f0836283dae5dce49dae6528fc Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 15 Aug 2023 10:58:11 +0200 Subject: Add parameters sdr.synchronous and mainloop.running_since --- src/Utils.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/Utils.cpp') diff --git a/src/Utils.cpp b/src/Utils.cpp index 94f198c..20297ea 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -25,7 +25,8 @@ along with ODR-DabMod. If not, see . */ -#include "sstream" +#include +#include #include "Utils.h" #include "GainControl.h" #if defined(HAVE_PRCTL) @@ -304,3 +305,13 @@ std::chrono::milliseconds transmission_frame_duration(unsigned int dabmode) } } + +time_t get_clock_realtime_seconds() +{ + struct timespec t; + if (clock_gettime(CLOCK_REALTIME, &t) != 0) { + throw std::runtime_error(std::string("Failed to retrieve CLOCK_REALTIME") + strerror(errno)); + } + + return t.tv_sec; +} -- cgit v1.2.3