Game logic network latency reporting (PostNetworkLatencyInSession) [Player Network SDK only]
[Player Network SDK only] Performance data collection.
Reporting game logic network latency can directly reflect the current interaction delay between the game client and server.
note
It is recommended to call in each frame callback.However, if considering performance for low-end mobile phones, try to ensure that the majority of frames per second can still make the call.If you choose to call it every few frames, there may be frame drops leading to null data in the statistics, and the more frames you skip, the higher the risk.
Supported platforms
- Unity
- Unreal Engine
Supports
Android, iOS, Windows platform.Supports
Android, iOS, Windows platform.Function Definition
- Unity
- Unreal Engine
void PostNetworkLatencyInSession(int latencyMs);
static void PostNetworkLatencyInSession(int latency_ms);
Input Parameters
- Unity
- Unreal Engine
| Parameters | Type | Description |
|---|---|---|
| latencyMs | int | Network latency Unit: milliseconds |
| Parameters | Type | Description |
|---|---|---|
| latency_ms | int32 | Network latency Unit: milliseconds |
Code Example
- Unity
- Unreal Engine
UnionAdapterAPI.GetReportService().PostNetworkLatencyInSession(50);
GUA_NAMESPACE::GUAReportService::PostNetworkLatencyInSession(50);