# timer

[← All adapters](/docs/reference/adapters)

```ts
timer(options?: TimerOptions): Source<undefined>
```

Trigger routes at a regular interval. Produces `undefined` as the message body.

For a wall-clock schedule ("every weekday at 09:00"), use [`cron()`](/docs/reference/adapters/cron), which understands timezones. `timer()` measures elapsed time, not clock time.

```ts
// Simple interval (every second)
.id('ticker')
.from(timer({ interval: 1000 }))

// Limited runs (10 times, then stop)
.id('batch-job')
.from(timer({ interval: 5000, repeatCount: 10 }))

// Start with delay
.id('delayed-start')
.from(timer({ interval: 1000, delay: 5000 }))

// Fixed rate (ignore execution time)
.id('heartbeat')
.from(timer({ interval: 1000, fixedRate: true }))

// Add random jitter to prevent synchronized execution
.id('distributed-task')
.from(timer({ interval: 1000, maxJitter: 200 }))
```

Options:

| Field | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `interval` | `Duration` | `1000` | No | Time between executions |
| `delay` | `Duration` | `0` | No | Delay before the first execution |
| `repeatCount` | `number` | `Infinity` | No | Number of executions before stopping |
| `fixedRate` | `boolean` | `false` | No | Execute at exact intervals ignoring processing time |
| `maxJitter` | `Duration` | `0` | No | Upper bound on a random delay added to each run, drawn uniformly from `[0, maxJitter)` |

**Headers added:** Timer metadata including fired time, counter, period, and next run time
