PingTime (3.14.0 600 API)
Date: 2025-11-24

com.marketfactory.zerogc.api

## Class PingTime

- java.lang.Object
- - com.marketfactory.zerogc.api.PingTime

-     public final class PingTime
      extends java.lang.Object

  Contains information about latencies.
  The client sends a ping message the server and the server sends a response back.
  The server timestamp is captured as wall-clock nanos past epoch.
  The Java client timestamps, `getReceived()` and `getSent()` are nano precision as per: `System.nanoTime()` and comparable to each other. You cannot compare these values to the 'atServer' timestamp as that is wall-clock time.
  The `getReceviedEpochNs()` returns the millisecond wall-clock timestamp the Ping was received at the client. This is comparable to the server's timestamp.
  If the PingTime values are not set, they will have a value of `NO_VALUE`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `NO_VALUE`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `copyValuesFrom(PingTime other)`
    `long` | `getAtServer()` Returns the epoch nano timestamp the ping was received at the server This timestamp is not comparable to the Sent or Received timestamps.
    `long` | `getReceived()` Returns the nano timestamp the ping was received back at the client.
    `long` | `getReceviedEpochNs()` Returns the epoch milliseconds the ping was received back at the client.
    `long` | `getSent()` Returns the nano timestamp the ping was sent from this client to the server.
    `void` | `set(long sent, long atServer, long received, long receivedAtClientEpochNs)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### NO_VALUE

          public static long NO_VALUE

  - ### Method Detail

    - #### set

          public void set(long sent,
                          long atServer,
                          long received,
                          long receivedAtClientEpochNs)

    - #### copyValuesFrom

          public void copyValuesFrom(PingTime other)

    - #### getSent

          public long getSent()

      Returns the nano timestamp the ping was sent from this client to the server. This timestamp is only comparable to nano timestamps from this VM - such as the value from `getReceived()`
      Returns:
        timestamp nanos the ping was sent to the server

    - #### getAtServer

          public long getAtServer()

      Returns the epoch nano timestamp the ping was received at the server This timestamp is not comparable to the Sent or Received timestamps.
      Returns:
        timestamp epoch nanos the ping was received at the server

    - #### getReceived

          public long getReceived()

      Returns the nano timestamp the ping was received back at the client. Received means that the ping response message was deserialized and processed. This timestamp is only comparable to nano timestamps from this VM - such as the value from `getSent()`.
      Returns:
        timestamp nanos the ping was received back at the client

    - #### getReceviedEpochNs

          public long getReceviedEpochNs()

      Returns the epoch milliseconds the ping was received back at the client. Received means that the ping response message was deserialized and processed. This timestamp is multiplied by 1_000_000 to make it easily comparable to the `getAtServer()` timestamp.
      Returns:
        timestamp epoch millis (*1_000_000) the ping was received back at the client

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`