SimConnect_RequestResponseTimes

The SimConnect_RequestResponseTimes function is used to provide some data on the performance of the client-server connection.

 

Syntax
HRESULT SimConnect_RequestResponseTimes(
    HANDLE  hSimConnect,
    DWORD  nCount,
    float*  fElapsedSeconds
    );

 

Parameters
Parameter Description Type
hSimConnect Handle to a SimConnect object. Integer
nCount Integer containing the number of elements in the array of floats. This should be set to five for the full range of timings, but can be less if only the first few are of interest. There is no point creating an array of greater than five floats. Integer
fElapsedSeconds

An array of nCount floats, containing the times. The five elements will contain the following:

0 - total round trip time

1 - time from the request till the packet is sent

2 - time from the request till the packet is received by the server

3 - time from the request till the response is made by the server

4 - time from the server response to the client receives the packet.

Array

 

Return Values

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return value Description
S_OK The function succeeded.
E_FAIL The function failed.

 

Example
int quit = 0;
bool fTesting = true;
      ....
while( quit == 0 )
    {
    hr = SimConnect_CallDispatch(hSimConnect, MyDispatchProc, NULL);
    Sleep(0);
    if (fTesting)
        {
        fTesting = false;
        float fElapsedSeconds[5];
        hr = SimConnect_RequestResponseTimes(hSimConnect, 5, &fElapsedSeconds[0]);
          ....
        }
    }

 

Remarks

This function should not be used as part of a final application, as it is costly in performance, but is available to help provide some performance data that can be used while building an testing a client application.

 

See Also