# RoomClient: rtt property

> The rtt read-only property of the RoomClient interface is the smallest recent round trip to the room, in milliseconds.

The **`rtt`** read-only property of the [`RoomClient`](/docs/client/room-client) interface is the round-trip time to the room, in milliseconds, the smallest of the client's recent pings.

## Value

A number of milliseconds. It's `0` until the room first answers a ping.

## Description

The client pings the room three times 100 ms apart after each connection is accepted, then every 2 seconds, or every 15 seconds while the room [sleeps](/docs/client/room-client/asleep). `rtt` is the smallest round trip of the last 8 pings, so a single slow ping doesn't move it; [`jitter`](/docs/client/room-client/jitter) says how much they vary. [`serverTick()`](/docs/client/room-client/servertick) and [`serverTime()`](/docs/client/room-client/servertime) are estimated from the same ping.

The client reports its `rtt` in each ping, and the room reads it as [`connection.rtt`](/docs/room/connection/rtt).

## Examples

### Showing the ping

The game shows the round trip in the corner of the screen, refreshed once a second, in green, yellow or red.

```ts
// ping.ts
import type { RoomClient } from "@irtio/client";

export function showPing(room: RoomClient, label: HTMLElement): void {
  setInterval(() => {
    const ms = Math.round(room.rtt);
    label.textContent = `${ms} ms`;
    label.className = ms < 80 ? "good" : ms < 160 ? "fair" : "poor";
  }, 1000);
}
```

## See also

- [`RoomClient.jitter`](/docs/client/room-client/jitter)
- [`RoomClient.serverTick()`](/docs/client/room-client/servertick)
- [`Connection.rtt`](/docs/room/connection/rtt), the room's side
