# Sampler

> Provides control over a CPU Profiler label.

## Definition

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

```csharp
public class Sampler
```

## Remarks

Sampler is a counter which produces timings information you can see in CPU Profiler. Use this class to get information about built-in or custom Profiler label.

Additional Resources: [Sampler.Get](/engine/6000.5/script-reference/unityengine/profiling/sampler/get.md), [CustomSampler](/engine/6000.5/script-reference/unityengine/profiling/customsampler.md), CPU Usage Profiler.

## Properties

| Property                                                                            | Description                                   |
| ----------------------------------------------------------------------------------- | --------------------------------------------- |
| [isValid](/engine/6000.5/script-reference/unityengine/profiling/sampler/isvalid.md) | Returns true if Sampler is valid. (Read Only) |
| [name](/engine/6000.5/script-reference/unityengine/profiling/sampler/name.md)       | Sampler name. (Read Only)                     |

## Methods

| Method                                                                                      | Description                                                                                                        |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [GetRecorder](/engine/6000.5/script-reference/unityengine/profiling/sampler/getrecorder.md) | Returns [Recorder](/engine/6000.5/script-reference/unityengine/profiling/recorder.md) associated with the Sampler. |

## Static Methods

| Method                                                                                | Description                                                                                                                     |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [Get](/engine/6000.5/script-reference/unityengine/profiling/sampler/get.md)           | Returns [Sampler](/engine/6000.5/script-reference/unityengine/profiling/sampler.md) object for the specific CPU Profiler label. |
| [GetNames](/engine/6000.5/script-reference/unityengine/profiling/sampler/getnames.md) | Returns number and names of all registered Profiler labels.                                                                     |
