From 6de663b6358a320c1e25b5fc6d69d03da3917e8f Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 18 Oct 2018 23:25:54 +0200 Subject: [PATCH] Ref T397, allow to set adjusted time --- src/blackmisc/timestampbased.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/blackmisc/timestampbased.h b/src/blackmisc/timestampbased.h index b57b053ed..3fc947634 100644 --- a/src/blackmisc/timestampbased.h +++ b/src/blackmisc/timestampbased.h @@ -191,6 +191,9 @@ namespace BlackMisc //! Timestamp with offset added for interpolation qint64 getAdjustedMSecsSinceEpoch() const { return this->getMSecsSinceEpoch() + this->getTimeOffsetMs(); } + //! Set timestamp with offset added for interpolation + void setAdjustedMSecsSinceEpoch(qint64 adjustedTimeMs) { this->setMSecsSinceEpoch(adjustedTimeMs - this->getTimeOffsetMs()); } + //! Time difference in ms (this -> compare) qint64 getAdjustedTimeDifferenceMs(qint64 compareTime) const { return this->getAdjustedMSecsSinceEpoch() - compareTime; }