# SingleSampleWithMetadata(IntPtr, int, void*)

> Creates profiling sample with a custom name that the markerPtr handle and metadata parameters has defined.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Profiling.LowLevel.Unsafe](/engine/6000.0/script-reference/unity/profiling/lowlevel/unsafe.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static void SingleSampleWithMetadata(IntPtr markerPtr, int metadataCount, void* metadata)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): Profiler marker handle.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Metadata parameters count.**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): Unsafe pointer to the ProfilerMarkerData array.

### Remarks

Sample created with [ProfilerUnsafeUtility.SingleSampleWithMetadata](/engine/6000.0/script-reference/unity/profiling/lowlevel/unsafe/profilerunsafeutility/singlesamplewithmetadata.md) shows up as a sample with zero duration in the Profiler hierarchy. In the Timeline view of the Profiler Window the provided *metadata* is available in the tooltip message. Use [HierarchyFrameDataView.GetItemMetadata](/engine/6000.0/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmetadata.md) to retrieve metadata programmatically.

If *markerPtr* points to a marker with [MarkerFlags.Counter](/engine/6000.0/script-reference/unity/profiling/lowlevel/markerflags/counter.md) defined, the metadata value can be retrieved with [FrameDataView.GetCounterValueAsInt](/engine/6000.0/script-reference/unityeditor/profiling/framedataview/getcountervalueasint.md) methods.

**Note:**  [ProfilerUnsafeUtility.SingleSampleWithMetadata](/engine/6000.0/script-reference/unity/profiling/lowlevel/unsafe/profilerunsafeutility/singlesamplewithmetadata.md) is thread safe and can be used in jobified code.

The low level Profiler API is included in a Release Build.
