1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-07 16:34:45 -04:00

SDRDaemon output: removed dependency on sys/time.h and unistd.h

This commit is contained in:
f4exb
2018-11-13 14:21:36 +01:00
parent be6e9a0bb4
commit 83069dec63
6 changed files with 23 additions and 17 deletions
+10
View File
@@ -25,3 +25,13 @@ uint64_t TimeUtil::nowms()
return value.count();
}
uint64_t TimeUtil::nowus()
{
auto now = std::chrono::system_clock::now();
auto now_ms = std::chrono::time_point_cast<std::chrono::microseconds>(now);
auto epoch = now_ms.time_since_epoch();
auto value = std::chrono::duration_cast<std::chrono::microseconds>(epoch);
return value.count();
}