# WireStats: messagesOut property

> The messagesOut property of the WireStats interface is the number of protocol messages the client has sent.

The **`messagesOut`** property of the [`WireStats`](/docs/client/wire-stats) interface is the number of protocol messages the client has sent since it was created, across reconnects.

## Value

A number, from 0. The client counts every message it sends: inputs, pings, owner writes, messages, calls and the `hello` of each connect. [`sent`](/docs/client/wire-stats/sent) splits it by message type.

## Examples

### Checking that writes are batched

A drag that writes an owned entity on every pointer move still sends at most one `write` message a tick, or one every 16 ms in a room without ticks. The client logs how many messages it sent during a drag.

```ts
// drag-cost.ts
import type { ReadyRoomClient } from "@irtio/client";

export function measureDrag(room: ReadyRoomClient) {
  const before = room.stats.messagesOut;
  return () => console.log(`the drag sent ${room.stats.messagesOut - before} messages`);
}
```

Call `measureDrag()` when the drag starts, and the function it returns when it ends.

## See also

- [`WireStats.bytesOut`](/docs/client/wire-stats/bytesout)
- [`WireStats.messagesIn`](/docs/client/wire-stats/messagesin)
