# GetSampleName(int)

> Gets the name of the specific sample.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Profiling](/engine/6000.7/script-reference/unityeditor/profiling.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public string GetSampleName(int sampleIndex)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index of the Profiler sample.

### Returns

| Type                                                           | Description                                                     |
| -------------------------------------------------------------- | --------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | Returns sample name. Returns *null* if sample index is invalid. |

### Remarks

**Note:** *GetSampleName* allocates string when called. Use [RawFrameDataView.GetSampleMarkerId](/engine/6000.7/script-reference/unityeditor/profiling/rawframedataview/getsamplemarkerid.md) to avaoid allocations for simple lookups.
