Files
CartoonFPS/Library/PackageCache/com.unity.test-framework.performance@92d1d09a72ed/Documentation~/measure-custom.md
SHOUTING_PIRATE 4c8592d0ab initial commit
2025-08-05 09:30:40 +01:00

16 lines
537 B
Markdown

# Measure.Custom()
When you want to record samples outside of frame time, method time, or profiler markers, use a custom measurement. It can be any value.
#### Example: Use a custom measurement to capture total allocated memory
``` csharp
[Test, Performance]
public void Test()
{
SampleGroup sampleGroup = new SampleGroup("TotalAllocatedMemory", SampleUnit.Megabyte, false);
var allocatedMemory = UnityEngine.Profiling.Profiler.GetTotalAllocatedMemoryLong() / 1048576f;
Measure.Custom(sampleGroup, allocatedMemory);
}
```