# Replay: tick event

> The tick event of the Replay interface fires when a tick is shown, by playing through it, stepping or seeking.

The **`tick`** event of the [`Replay`](/docs/client/replay) interface fires when the replay shows a tick: by [`play()`](/docs/client/replay/play) or [`step()`](/docs/client/replay/step) moving to it, or by [`seek()`](/docs/client/replay/seek).

## Syntax

```ts
addEventListener("tick", (event) => {})
```

## Event type

A generic `Event`. Read the tick shown from the replay's `tick` property.

## Description

The event fires after the tick's entity and presence callbacks, so the replay's [`entities`](/docs/client/replay/entities), [`state`](/docs/client/replay/state) and [`presence`](/docs/client/replay/presence) are those of the tick by then. Use it for what depends on the whole tick rather than one entity, such as a clock or a scoreboard.

## Examples

### Showing a match clock

A replay viewer shows the match clock, counting from the replay's first tick.

```ts
// match-clock.ts
import type { Replay } from "@irtio/client/replay";

export function matchClock(replay: Replay, label: HTMLElement): void {
  replay.addEventListener("tick", () => {
    const seconds = (replay.tick - replay.firstTick) / replay.tickRate;
    label.textContent = `${seconds.toFixed(1)} s`;
  });
}
```

## See also

- [`Replay.seek()`](/docs/client/replay/seek)
- [`Replay.step()`](/docs/client/replay/step)
- [`ended` event](/docs/client/replay/ended-event)
