# ProfilerTimeSampleSelection

> An object describing a selection made in a frame time sample based Profiler module.

## Definition

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

```csharp
public sealed class ProfilerTimeSampleSelection
```

## Remarks

Use [ProfilerWindow.GetFrameTimeViewSampleSelectionController](/engine/6000.6/script-reference/unityeditor/profilerwindow/getframetimeviewsampleselectioncontroller.md) to get a frame time sample based Profiler module, then use [IProfilerFrameTimeViewSampleSelectionController.selection](/engine/6000.6/script-reference/unityeditor/profiling/iprofilerframetimeviewsampleselectioncontroller/selection.md) to get an object describing the current selection. You can create a selection object and set the current selection in a frame time sample based Profiler module via [IProfilerFrameTimeViewSampleSelectionController.SetSelection](/engine/6000.6/script-reference/unityeditor/profiling/iprofilerframetimeviewsampleselectioncontroller/setselection.md).

## Constructors

| Constructor                                                                                                                                                                                                                                                                                                            | Description                                                                                                                                                                                                                                                        |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [ProfilerTimeSampleSelection(System.Int64,System.String,System.String,System.UInt64,System.Collections.Generic.IList\{System.Int32},System.String)](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/ctor.md#profilertimesampleselection\(long-string-string-ulong-ilistint-string\)) | Constructs a selection object that can be passed to [IProfilerFrameTimeViewSampleSelectionController.SetSelection](/engine/6000.6/script-reference/unityeditor/profiling/iprofilerframetimeviewsampleselectioncontroller/setselection.md) to change the selection. |
| [ProfilerTimeSampleSelection(System.Int64,System.String,System.String,System.UInt64,System.Int32,System.String)](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/ctor.md#profilertimesampleselection\(long-string-string-ulong-int-string\))                                         | Constructs a selection object that can be passed to [IProfilerFrameTimeViewSampleSelectionController.SetSelection](/engine/6000.6/script-reference/unityeditor/profiling/iprofilerframetimeviewsampleselectioncontroller/setselection.md) to change the selection. |
| [ProfilerTimeSampleSelection(UnityEditor.Profiling.ProfilerTimeSampleSelection)](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/ctor.md#profilertimesampleselection\(profilertimesampleselection\))                                                                                 | Constructs a selection object that can be passed to [IProfilerFrameTimeViewSampleSelectionController.SetSelection](/engine/6000.6/script-reference/unityeditor/profiling/iprofilerframetimeviewsampleselectioncontroller/setselection.md) to change the selection. |

## Properties

| Property                                                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [frameIndex](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/frameindex.md)               | The 0 based frame index. Note that the Profiler Window UI shows the frame index as n+1.                                                                                                                                                                                                                                                                                                                                                                           |
| [markerNamePath](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/markernamepath.md)       | A list of the names of all [ProfilerMarkers](/engine/6000.6/script-reference/unity/profiling/profilermarker.md) that make up the Sample Stack of this selection. Unity populates this list on a selection object if it was passed to [IProfilerFrameTimeViewSampleSelectionController.SetSelection](/engine/6000.6/script-reference/unityeditor/profiling/iprofilerframetimeviewsampleselectioncontroller/setselection.md) and was accepted as a valid selection. |
| [markerPathDepth](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/markerpathdepth.md)     | A shorthand for \_markerNamePath.Count. When \_markerNamePath is null, this value is 0.                                                                                                                                                                                                                                                                                                                                                                           |
| [rawSampleIndex](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/rawsampleindex.md)       | The raw index of a sample, i.e. the index as if would be used with [RawFrameDataView](/engine/6000.6/script-reference/unityeditor/profiling/rawframedataview.md) and NOT an Item ID as it would be used with [HierarchyFrameDataView](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview.md).                                                                                                                                           |
| [rawSampleIndices](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/rawsampleindices.md)   | A sample selected in Hierarchy view might correspond to multiple samples in [RawFrameDataView](/engine/6000.6/script-reference/unityeditor/profiling/rawframedataview.md). This is a list of all of these sample indices.                                                                                                                                                                                                                                         |
| [sampleDisplayName](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/sampledisplayname.md) | The name of the Sample as it is displayed in the [Profiler Window](/engine/6000.6/manual/analysis/profiler/window.md). This might be a shorter version than the last item in \_markerNamePath.                                                                                                                                                                                                                                                                    |
| [threadGroupName](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/threadgroupname.md)     | The name of the group of the thread this sample resides in. When the thread is not part of a thread group, this value is string.empty.                                                                                                                                                                                                                                                                                                                            |
| [threadId](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/threadid.md)                   | The ID of the thread this sample resides in.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [threadName](/engine/6000.6/script-reference/unityeditor/profiling/profilertimesampleselection/threadname.md)               | The name of the thread this sample resides in.                                                                                                                                                                                                                                                                                                                                                                                                                    |
