mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Ref T129, utility function for timestamp based interface
This commit is contained in:
committed by
Mathew Sutcliffe
parent
ba8d0c1f64
commit
bfa3908a99
@@ -126,6 +126,12 @@ namespace BlackMisc
|
||||
return dt > 0 ? dt : dt * -1;
|
||||
}
|
||||
|
||||
qint64 ITimestampBased::msecsToNow() const
|
||||
{
|
||||
if (this->m_timestampMSecsSinceEpoch < 0) return QDateTime::currentMSecsSinceEpoch();
|
||||
return QDateTime::currentMSecsSinceEpoch() - this->m_timestampMSecsSinceEpoch;
|
||||
}
|
||||
|
||||
void ITimestampBased::setCurrentUtcTime()
|
||||
{
|
||||
this->m_timestampMSecsSinceEpoch = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
Reference in New Issue
Block a user