microRTPS: timesync: fix unit conversion

This commit is contained in:
TSC21 2020-03-09 18:59:18 +00:00 committed by Nuno Marques
parent 59869b2350
commit a3487ab8a3
1 changed files with 2 additions and 2 deletions

View File

@ -142,8 +142,8 @@ public:
@[end if]@
inline int64_t getOffset() { return _offset_ns.load(); }
inline void addOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL + _offset_ns.load()) / 10000ULL; }
inline void subtractOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL - _offset_ns.load()) / 10000ULL; }
inline void addOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL + _offset_ns.load()) / 1000ULL; }
inline void subtractOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL - _offset_ns.load()) / 1000ULL; }
private:
std::atomic<int64_t> _offset_ns;