# Connection: rtt property

> The rtt read-only property of the Connection interface is the client's lowest recent round trip to the room, in milliseconds, as the client reports it.

The **`rtt`** read-only property of the [`Connection`](/docs/room/connection) interface is the client's lowest recent round trip to the room, in milliseconds, as the client reports it in its pings.

## Value

A number of milliseconds, or `undefined` until the client's first ping, and always for a client older than protocol 3.

## Description

The client measures `rtt` and reports it, so a client can lie about it, as about its view tick. Cap whatever a game gives for it, such as the extra time a rhythm hit is judged with.

## Examples

### Widening a rhythm game's hit window, up to a cap

```ts
// rhythm.ts
import { defineRoom } from "@irtio/room";

const WINDOW_MS = 60;
const MAX_ALLOWANCE_MS = 80;

export default defineRoom({
  data: () => ({ beatAt: 0 }),
  onMessage(room, connection, message) {
    if (message !== "hit") return;
    const allowance = Math.min((connection.rtt ?? 0) / 2, MAX_ALLOWANCE_MS);
    const off = Math.abs(room.now() - allowance - room.data.beatAt);
    room.send(connection, { type: "judged", good: off <= WINDOW_MS });
  },
});
```

## See also

- [`Connection.viewTick`](/docs/room/connection/viewtick)
- [`Connection.protocol`](/docs/room/connection/protocol)
