[NetCode] How to get RTT?

Hi,

I’m currently stuck on this (apparently?) simple task: I want to show on screen the Round Trip Time (RTT) (aka Latency, Ping…) of packets from client to server, similar to what is shown in NetDbg tool

5934440--634874--upload_2020-6-3_12-38-12.png

I’ve digged in the documentation but I found only indirect references:

Is there a simple way of accessing or computing RTT (and possibly other network stats)?

Thank you, any help is appreciated :slight_smile:

Don’t know if there is a better way, but this seems to work:

Entities.ForEach((ref NetworkSnapshotAckComponent ack) =>
{
    var rtt = ack.EstimatedRTT;
    // ...
});
2 Likes