mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Ref T259, Ref T243 timestamp utility functions
This commit is contained in:
@@ -46,6 +46,9 @@ namespace BlackMisc
|
||||
//! Timestamp as ms value
|
||||
qint64 getMSecsSinceEpoch() const { return m_timestampMSecsSinceEpoch; }
|
||||
|
||||
//! Time difference in ms
|
||||
qint64 getTimeDifferenceMs(qint64 compareTime) const { return compareTime - this->getMSecsSinceEpoch(); }
|
||||
|
||||
//! Set to null
|
||||
void setTimestampToNull();
|
||||
|
||||
@@ -170,6 +173,9 @@ namespace BlackMisc
|
||||
//! Timestamp with offset added for interpolation
|
||||
qint64 getAdjustedMSecsSinceEpoch() const { return this->getMSecsSinceEpoch() + this->getTimeOffsetMs(); }
|
||||
|
||||
//! Time difference in ms (this -> compare)
|
||||
qint64 getAdjustedTimeDifferenceMs(qint64 compareTime) const { return this->getAdjustedMSecsSinceEpoch() - compareTime; }
|
||||
|
||||
//! Timestamp and offset
|
||||
QString getTimestampAndOffset(bool formatted) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user