study/first_study/Library/PackageCache/com.unity.test-framework.performance@0840f58e4562/Documentation~/measure-custom.md
jh04010421 739d49f1a0 Unity | 2026.01.20
수업 실습 파일
2026-01-20 11:01:57 +09:00

537 B

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

[Test, Performance]
public void Test()
{
    SampleGroup sampleGroup = new SampleGroup("TotalAllocatedMemory", SampleUnit.Megabyte, false);
    var allocatedMemory = UnityEngine.Profiling.Profiler.GetTotalAllocatedMemoryLong() / 1048576f;
    Measure.Custom(sampleGroup, allocatedMemory);
}