summaryrefslogtreecommitdiffstats
path: root/src/Utils.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-17 11:30:17 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-17 11:30:44 +0100
commit7ca7edbc5a80b3869fb0772946c00c76c264da8d (patch)
treef9b8fabd56fe422d637475b882e50982027d524d /src/Utils.h
parent4f7636694a752fa8c652c684a3c9ebf1488ceaa4 (diff)
downloaddabmod-7ca7edbc5a80b3869fb0772946c00c76c264da8d.tar.gz
dabmod-7ca7edbc5a80b3869fb0772946c00c76c264da8d.tar.bz2
dabmod-7ca7edbc5a80b3869fb0772946c00c76c264da8d.zip
Don't use CLOCK_GETTIME in SDR
Diffstat (limited to 'src/Utils.h')
-rw-r--r--src/Utils.h22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/Utils.h b/src/Utils.h
index 5d5831b..9e88488 100644
--- a/src/Utils.h
+++ b/src/Utils.h
@@ -3,7 +3,7 @@
Her Majesty the Queen in Right of Canada (Communications Research
Center Canada)
- Copyright (C) 2017
+ Copyright (C) 2018
Matthias P. Braendli, matthias.braendli@mpb.li
http://opendigitalradio.org
@@ -36,6 +36,7 @@
#include <stdio.h>
#include <time.h>
#include <string>
+#include <chrono>
void printUsage(const char* progName);
@@ -43,22 +44,6 @@ void printVersion(void);
void printStartupInfo(void);
-inline long timespecdiff_us(struct timespec& oldTime, struct timespec& time)
-{
- long tv_sec;
- long tv_nsec;
- if (time.tv_nsec < oldTime.tv_nsec) {
- tv_sec = time.tv_sec - 1 - oldTime.tv_sec;
- tv_nsec = 1000000000L + time.tv_nsec - oldTime.tv_nsec;
- }
- else {
- tv_sec = time.tv_sec - oldTime.tv_sec;
- tv_nsec = time.tv_nsec - oldTime.tv_nsec;
- }
-
- return tv_sec * 1000 + tv_nsec / 1000;
-}
-
// Set SCHED_RR with priority prio (0=lowest)
int set_realtime_prio(int prio);
@@ -70,5 +55,4 @@ double parseChannel(const std::string& chan);
// dabMode is either 1, 2, 3, 4, corresponding to TM I, TM II, TM III and TM IV.
// throws a runtime_error if dabMode is not one of these values.
-int transmission_frame_duration_ms(unsigned int dabMode);
-
+std::chrono::milliseconds transmission_frame_duration(unsigned int dabmode);