# EndOfFrameAsync(CancellationToken)

> Resumes execution after all Unity subsystems have run for the current frame.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static Awaitable EndOfFrameAsync(CancellationToken cancellationToken = default)
```

### Parameters

**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): Optional cancellation token used to signal cancellation.

### Returns

| Type                                                                  | Description |
| --------------------------------------------------------------------- | ----------- |
| [Awaitable](/engine/6000.5/script-reference/unityengine/awaitable.md) |             |

### Remarks

**Note:** This method can only be called from the main thread and always completes on main thread. Also, in Editor, this awaitable is incompatible with BatchMode and requires the game to be in play mode (in edit mode, it will never complete).

### Examples

```csharp
private async Awaitable DoSomethingAsync()
{
   Debug.Log("Before game systems got updated for current thread");
   await Awaitable.EndOfFrameAsync();
   Debug.Log("After game systems got updated for current thread");
}
```
