• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS20 Has anyone had any luck with SimConnect_RequestResponseTimes?

Messages
61
Country
us-newyork
Well, I have another doozy in store: I am trying to gather some info on timing and performance, and I'm trying to use seemingly valid and well-documented SimConnect call SimConnect_RequestResponseTimes(). However, whatever I do and wherever I call it, I am getting no responses, just zeroes. Here is my code (pretty much what is in the SDK):

Code:
void    ReportServerResponseTimes(void)
{
    float fElapsedSeconds[5];
    SimConnect_RequestResponseTimes(hSimConnect, 5, &fElapsedSeconds[0]);
    if (bVerbose) fprintf(stderr, "total round trip time: %f\n",                                                fElapsedSeconds[0]);
    if (bVerbose) fprintf(stderr, "time from the request till the packet is sent: %f\n",                        fElapsedSeconds[1]);
    if (bVerbose) fprintf(stderr, "time from the request till the packet is received by the server: %f\n",        fElapsedSeconds[2]);
    if (bVerbose) fprintf(stderr, "time from the request till the response is made by the server: %f\n",        fElapsedSeconds[3]);
    if (bVerbose) fprintf(stderr, "time from the server response to the client receives the packet: %f\n",        fElapsedSeconds[4]);
}

I rigged up my code to call it just once, at a key press, or let it be called during an interval, before and after any of the SimConnect_SetDataOnSimObject() calls - nothing, just zeroes. Does anyone know how to get this to work?
 
Hi Hornet,

I have no idea, haven't tried that function in ages, but for reference, are you trying this from a remote/external app or within a WASM module? If the units it's returning are actually whole seconds (as seems to be documented... don't remember now if that's true), then I could see how those could easily be zeros since the actual times are surely in low millisecond counts (even for an external app these days, in most cases).

EDIT: oh well I guess those could be fractions of seconds... doesn't say what the actual resolution is. Anyway I wonder how using from inside WASM would change things.

-Max
 
Hi Hornet,

I have no idea, haven't tried that function in ages, but for reference, are you trying this from a remote/external app or within a WASM module? If the units it's returning are actually whole seconds (as seems to be documented... don't remember now if that's true), then I could see how those could easily be zeros since the actual times are surely in low millisecond counts (even for an external app these days, in most cases).

EDIT: oh well I guess those could be fractions of seconds... doesn't say what the actual resolution is. Anyway I wonder how using from inside WASM would change things.

-Max
Hi Max!

I am calling this from a WASM module (standalone app), basically, a sample from SDK, and then sending some data on SimObject and expecting to see the return times.

And yes, I was thinking of the precision too, so I was multiplying:

Code:
fElapsedSeconds[n]*1000000.0f

But still all zeros...
 
Back
Top