# GetSampleTimeMs(int)

> Gets the duration of sample. The amount of time is expressed in milliseconds.

## Definition

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

```csharp
public float GetSampleTimeMs(int sampleIndex)
```

### Parameters

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

### Returns

| Type                                                          | Description                              |
| ------------------------------------------------------------- | ---------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | Returns sample duration in milliseconds. |
