# ToArray()

> Use to convert collected samples to an array.

## Definition

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

```csharp
public ProfilerRecorderSample[] ToArray()
```

### Returns

| Type                                                                                                    | Description |
| ------------------------------------------------------------------------------------------------------- | ----------- |
| [ProfilerRecorderSample\[\]](/engine/6000.7/script-reference/unity/profiling/profilerrecordersample.md) |             |

### Remarks

**Note:** Accessing this method allocates a new managed array on every access, which contributes to GC allocated memory. As such, this might slow down the performance of your application.
