# SetAction(Action, long, long)

> Set the action that should be executed when the button is pressed.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.7/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public void SetAction(Action clickEvent, long delay, long interval)
```

### Parameters

**** (\[Action]\(https\://learn.microsoft.com/dotnet/api/system.action)): The action to execute.**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): The initial delay before the action is executed for the first time. Value is defined in milliseconds.**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): The interval between each execution of the action. Value is defined in milliseconds.
