mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:38:15 +08:00
Ref T280, FSX/P3D also measure time of inner SimConnectProc to see if SimConnect_CallDispatch has any influence
This commit is contained in:
@@ -36,6 +36,7 @@ namespace BlackSimPlugin
|
||||
// IMPORTANT:
|
||||
// all tasks called in this function (ie all called functions) must perform fast or shall be called asynchronously
|
||||
|
||||
const qint64 procTimeStart = QDateTime::currentMSecsSinceEpoch();
|
||||
CSimulatorFsxCommon *simulatorFsxP3D = static_cast<CSimulatorFsxCommon *>(pContext);
|
||||
const SIMCONNECT_RECV_ID recvId = static_cast<SIMCONNECT_RECV_ID>(pData->dwID);
|
||||
simulatorFsxP3D->m_dispatchLastReceiveId = recvId;
|
||||
@@ -102,10 +103,10 @@ namespace BlackSimPlugin
|
||||
}
|
||||
case SystemEventPause:
|
||||
{
|
||||
const bool p = event->dwData ? true : false;
|
||||
if (simulatorFsxP3D->m_simPaused != p)
|
||||
const bool paused = event->dwData ? true : false;
|
||||
if (simulatorFsxP3D->m_simPaused != paused)
|
||||
{
|
||||
simulatorFsxP3D->m_simPaused = p;
|
||||
simulatorFsxP3D->m_simPaused = paused;
|
||||
simulatorFsxP3D->emitSimulatorCombinedStatus();
|
||||
}
|
||||
break;
|
||||
@@ -354,6 +355,14 @@ namespace BlackSimPlugin
|
||||
default:
|
||||
break;
|
||||
} // main switch
|
||||
|
||||
// performance stats
|
||||
const qint64 procTimeEnd = QDateTime::currentMSecsSinceEpoch();
|
||||
simulatorFsxP3D->m_dispatchProcTimeMs = procTimeEnd - procTimeStart;
|
||||
if (simulatorFsxP3D->m_dispatchProcTimeMs > simulatorFsxP3D->m_dispatchProcMaxTimeMs)
|
||||
{
|
||||
simulatorFsxP3D->m_dispatchProcMaxTimeMs = simulatorFsxP3D->m_dispatchProcTimeMs;
|
||||
}
|
||||
} // method
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user