# rmp::behavior::Timer

> Calls you every N seconds.

Source: https://omardev29.github.io/rmp-docs/reference/behaviors/Timer.html

behavior `#include <rmp/behavior.h>` [include/rmp/behavior.h:434](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/behavior.h#L434-L455)

struct Timer

Calls you every N seconds. Shooting, blinking, a countdown.

Added to an object with `add<rmp::behavior::Timer>()`; the framework calls its `_update` with the object it is on.

## Fields

| Field | Type | Default | What it is |
|---|---|---|---|
| `seconds` | `float` | `1` | Between calls; 0 = it never fires |
| `repeat` | `bool` | `true` | False = one call, and then it is spent |
| `on_timeout` | `Callback<Object &>` |  | Called with the object the Timer is on. A frame longer than `seconds` calls it once for every interval that frame covered, so a countdown keeps time on a slow machine — up to a thousand: more than that owed in one frame is an interval far shorter than any frame, and the rest of the time is dropped and said once. |
| `ours` | `struct { … }` |  | What it is keeping track of. Readable, because sometimes you want it; not yours to write. It is one PUBLIC member and not a private block because a struct with a private member is not an aggregate in C++20, and then `{ .speed = 320 }` stops compiling — which is the whole design. The name is the fence. |
