> For the complete documentation index, see [llms.txt](https://pahutyakv.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pahutyakv.gitbook.io/docs/delayed/time-based-actions.md).

# Time-Based Actions

The `Delayed.Time` module executes actions after a specific time delay or over a defined duration. It supports both scaled and unscaled time, making it ideal for gameplay logic, UI animations, cooldowns, and progress-based systems.

***

### <mark style="color:$success;">Methods</mark>

<details>

<summary><strong>After(float seconds, Action callback, bool ignoreTimeScale = false)</strong></summary>

Executes the `callback` once after the specified delay in `seconds`.

```csharp
Delayed.Time.After(2f, () => Debug.Log("2 seconds passed!"));
```

</details>

<details>

<summary><strong>Every(float seconds, Action callback, int repeats = -1, bool ignoreTimeScale = false)</strong></summary>

Executes the `callback` repeatedly at the specified interval.\
Do not specify an interval to repeat the action every second.

```csharp
Delayed.Time.Every(3f, () => Debug.Log("Tick!"), 5);
```

</details>

<details>

<summary><strong>Next(Action callback, bool ignoreTimeScale = false)</strong></summary>

Executes the `callback` after 1 second.

```csharp
Delayed.Time.Next(() => Debug.Log("Next second!"));
```

</details>

<details>

<summary><strong>Interpolate(float seconds, Action onTick, bool ignoreTimeScale = false)</strong></summary>

Invokes `onTick` every frame with normalized progress (0 → 1) over the duration of `seconds`.

```csharp
Delayed.Time.Interpolate(3f, progress => value = Mathf.Lerp(0, 100, progress));
```

</details>

***

### <mark style="color:$primary;">Notes</mark>

* Infinite repeats: `repeats = -1`.
* `ignoreTimeScale = true` makes the action independent of `Time.timeScale`, useful for paused or slow-motion scenarios.
* Can be combined with `DelayedChain` for sequential timed events.
