# GetSampleTimeNs(int)

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

## Definition

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

```csharp
public ulong GetSampleTimeNs(int sampleIndex)
```

### Parameters

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

### Returns

| Type                                                          | Description                             |
| ------------------------------------------------------------- | --------------------------------------- |
| [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | Returns sample duration in nanoseconds. |
