# Measure Ping

**URL:** <https://community.coherence.io/t/measure-ping/558>\
**Category:** Help\
**Created:** [August 4, 2024, 2:05pm UTC](https://community.coherence.io/t/measure-ping/558 "2024-08-04T14:05:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![codya](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@codya](https://community.coherence.io/u/codya)\
**Post date:** [August 4, 2024, 2:05pm UTC](https://community.coherence.io/t/measure-ping/558/1 "2024-08-04T14:05:47Z")

</div>

How do I measure ping in milliseconds in coherence?

---

<div class="post-metadata">

**Author:** ![brit](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/brit/32/34_2.png) [@brit](https://community.coherence.io/u/brit)\
**Post date:** [August 4, 2024, 2:34pm UTC](https://community.coherence.io/t/measure-ping/558/2 "2024-08-04T14:34:57Z")

</div>

Once connected, you can use:

```auto
        CoherenceBridge bridge;
        if (CoherenceBridgeStore.TryGetBridge(gameObject.scene, out bridge))
        {
            Debug.Log(bridge.Client.Ping.ToString());
        }

```

---

<div class="post-metadata">

**Author:** ![codya](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@codya](https://community.coherence.io/u/codya)\
**Post date:** [August 4, 2024, 2:53pm UTC](https://community.coherence.io/t/measure-ping/558/3 "2024-08-04T14:53:14Z")

</div>

> [@brit](#):
>
> `Debug.Log(bridge.Client.Ping.ToString());`

Thanks, is the ping measured as the time the message takes to go from the client to the server? or is it the time the message takes to go from the client to the server and then from the server to the client?

---

<div class="post-metadata">

**Author:** ![miguel-coherence](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/miguel-coherence/32/101_2.png) [@miguel-coherence](https://community.coherence.io/u/miguel-coherence)\
**Post date:** [August 4, 2024, 7:27pm UTC](https://community.coherence.io/t/measure-ping/558/4 "2024-08-04T19:27:01Z")

</div>

The Ping struct gives you both the average latency and the average roundtrip times.

This is the measurement of a message travelling from the client to the replication server. (and back in case of RTT)

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex017/uploads/coherence/original/1X/b3aa79eb9519fac7aad7eba18f15a1e8ce60f6e2.png) [@system](https://community.coherence.io/u/system)\
**Post date:** [November 2, 2024, 7:27pm UTC](https://community.coherence.io/t/measure-ping/558/5 "2024-11-02T19:27:56Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
