# Get(string)

> Returns Sampler object for the specific CPU Profiler label.

## Definition

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

```csharp
public static Sampler Get(string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Profiler Sampler name.

### Returns

| Type                                                                        | Description                                                                                                                  |
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [Sampler](/engine/6000.5/script-reference/unityengine/profiling/sampler.md) | [Sampler](/engine/6000.5/script-reference/unityengine/profiling/sampler.md) object which represents specific profiler label. |

### Remarks

You can use this function to get a Sampler associated with a built-in or custom label. The *name* parameter is the same you can see in Hierarchy view of the Profiler Window. If label with the specified *name* parameter does not exist or not available in the Player, an invalid Sampler object will be returned. You can use [Sampler.isValid](/engine/6000.5/script-reference/unityengine/profiling/sampler/isvalid.md) to verify if Sampler is valid.

```csharp
using UnityEngine;
using UnityEngine.Profiling;

public class ExampleClass : MonoBehaviour
{
    Sampler sampler;
    void Start()
    {
        sampler = Sampler.Get("BehaviourUpdate");
    }
}
```

**Get** can be used to obtain any existing Sampler including custom Sampler. Return value is always Sampler type and can not be casted to CustomSampler.

**Note:** At the moment all built-in counters are available only in the Editor and Development Players. **Get** in non-Development Players returns invalid Sampler.

Additional Resources: [Sampler](/engine/6000.5/script-reference/unityengine/profiling/sampler.md), [Sampler.isValid](/engine/6000.5/script-reference/unityengine/profiling/sampler/isvalid.md),  CPU Usage Profiler.
